Lets start with the code in question:
Code:
CODE
public Matrix multiplyMatrix(Matrix B)
{
if(coln != B.returnRowlength())
{
Matrix local = new Matrix(rows, B.returnColnlength());
int value = 0;
for(int i = 0; i < rows; i++) // Controls row count
{
for(int j = 0; j < B.returnColnlength(); j++) // Control coln count
{
for(int k = 0; k < coln; k++)
{
value = value + (array[i][k] * B.returnValue(k,j));
local[i][j] = value;
}
}
}
return local;
}
else
{
System.out.print("Dimension does not match. Multiplay function cannot be executed.");
}
}
{
if(coln != B.returnRowlength())
{
Matrix local = new Matrix(rows, B.returnColnlength());
int value = 0;
for(int i = 0; i < rows; i++) // Controls row count
{
for(int j = 0; j < B.returnColnlength(); j++) // Control coln count
{
for(int k = 0; k < coln; k++)
{
value = value + (array[i][k] * B.returnValue(k,j));
local[i][j] = value;
}
}
}
return local;
}
else
{
System.out.print("Dimension does not match. Multiplay function cannot be executed.");
}
}
The problem is within the: local[i][j] = value;
I get this error message: array required, But matrix found
local is an array, so why does it say array required?
Thanks,kvarnerexpress

