Hey, so I have to make a program that has to multiply two 3x3 matrices (among other things). I used classes to do the project, but I just can't seem to get this multiplication to work. Here is my code so far:
void matrix::mult(const matrix& u)
{
double c[9];
double a[9];
for (int i=0; i<rows; i++)
{
for (int j=0; j<columns; j++)
{
for(int r=0; r<columns; r++)
{
c[i*columns+j]+=a[i*columns+r]*u.data[r*columns+j];
}
}
}
}
Any advice would be great, and please let me know if there's anything I should clarify. Thank You.