O
O.B.
I have the following:
public class Matrix3D
{
private const int SIZE = 3;
public double[,] matrix = new double[SIZE, SIZE];
public static Matrix3D operator *(Matrix3D lhs, Matrix3D rhs)
{
Matrix3D result = new Matrix3D();
for (int i = 0; i < SIZE; i++)
{
for (int j = 0; j < SIZE; j++)
{
for (int k = 0; i < SIZE; k++)
{
result[i, j] += lhs[i, k] * rhs[k, j];
}
}
}
return result;
}
}
When I compile, I get the error:
Cannot apply indexing with [] to an expression of type 'Matrix3D'
Help?
public class Matrix3D
{
private const int SIZE = 3;
public double[,] matrix = new double[SIZE, SIZE];
public static Matrix3D operator *(Matrix3D lhs, Matrix3D rhs)
{
Matrix3D result = new Matrix3D();
for (int i = 0; i < SIZE; i++)
{
for (int j = 0; j < SIZE; j++)
{
for (int k = 0; i < SIZE; k++)
{
result[i, j] += lhs[i, k] * rhs[k, j];
}
}
}
return result;
}
}
When I compile, I get the error:
Cannot apply indexing with [] to an expression of type 'Matrix3D'
Help?