Created
November 10, 2016 20:34
-
-
Save pubudu91/fbe6ef467c8798dcf1834b22ca0ad3e5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void multiply1D(Matrix1D *A, Matrix1D *B, Matrix1D *C, int n) { | |
for (int i = 0; i < n; ++i) { | |
double *Arow = &A->matrix[i * n]; | |
double *Crow = &C->matrix[i * n]; | |
for (int j = 0; j < n; ++j) { | |
double sum = 0; | |
for (int k = 0; k < n; ++k) | |
sum += *(Arow + k) * B->matrix[k * n + j]; | |
*(Crow + j) = sum; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment