Function for Matrix Multiplication
/* Multiply matrix m1 by m2, store the product in matrix m3 */
void mult(int m1[][MAXSIZE],
int m2[][MAXSIZE],
int m3[][MAXSIZE],
int n)
{
int i, j, k;
for(i = 0; i < n; ++i)
for(j = 0; j < n; ++j) {
m3[i][j] = 0;
for(k = 0; k < n; ++k)
m3[i][j] += m1[i][k] *
m2[k][j];
}
}
Previous slide
Next slide
Back to first slide
View graphic version