Umm.. trying to work out what on earth you are talking about![]()
Which takes longer in general, Adidtion of two matricies, Transposition of a matrix, or mulitplication of two matricies?
Umm.. trying to work out what on earth you are talking about![]()
lol, this might help. which takes the longest ....
Addition
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
A[i][j] = B[i][j] + C[i][j];
Multiplication
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
for (k = A[i][j] = 0; k < n; k++)
A[i][j] += B[i][k] * C[k][j];
Transposition
for (i = 0; i < n-1; i++)
for (j = i+1; j < n; j++){
temp = A[i][j];
A[i][j] = A[j][i];
A[j][i] = temp;
}
Bookmarks