-
Matrix Multiplication
For those that don't know me, I am not good at programming due to a severe lack of knowledge.
Ok, I know how to make an array, and I think I know how to add 2 arrays(3x3):
for(int row=0 , row<3 , row++)
{for(int col=0 , col <3 , col++)
{sum[row][col]=A[row][col]+B[row][col];
}}
I think that is right. But the problem is, that I need to multiply the 2 arrays, not add them, and I can't figure it out, any help would be nice.
-
Hey, the solution in pseudo-code is
// multiplies 'a' of the order (m x p) with 'b' of the order (p x n) into 'c'
MATMUL(int **a,int **b,int **c,int m,int p,int n)
for i = 1 to m
for j = 1 to n
c[i][j] = 0
for k = 1 to p
c[i][j] = c[i][j] + a[i][k] * b[k][j]
}
}
}
-
what is matmul? << that was astupid question.