Commit 48c160ca authored by Marc's avatar Marc
Browse files

transposed matrix multiplication

parent c48f3ca3
......@@ -43,7 +43,7 @@ int main()
for(int i=0; i<N; i++)
for(int j=0; j<N; j++) {
A[i][j] = rand()%10;
B[i][j] = rand()%10;
B[j][i] = rand()%10;
}
int sum = 0;
......@@ -55,7 +55,7 @@ int main()
for(int i=0; i<N; i++)
for(int j=0; j<N; j++){
for(int k=0; k<N; k++){
aux = computeCell(A[i][k],B[k][j]);
aux = computeCell(A[i][k],B[j][k]);
sum = computeSum(sum, aux);
}
C[i][j] = sum;
......
......@@ -37,7 +37,7 @@ int main()
for(int i=0; i<N; i++)
for(int j=0; j<N; j++) {
A[i][j] = rand()%10;
B[i][j] = rand()%10;
B[j][i] = rand()%10;
}
int sum = 0;
......@@ -49,7 +49,7 @@ int main()
for(int i=0; i<N; i++)
for(int j=0; j<N; j++){
for(int k=0; k<N; k++){
aux = computeCell(A[i][k],B[k][j]);
aux = computeCell(A[i][k],B[j][k]);
sum = computeSum(sum, aux);
}
C[i][j] = sum;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment