Skip to content

Instantly share code, notes, and snippets.

@pubudu91
Created November 10, 2016 21:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pubudu91/4270f85f8416a48c36bbaa7e8b91841e to your computer and use it in GitHub Desktop.
Save pubudu91/4270f85f8416a48c36bbaa7e8b91841e to your computer and use it in GitHub Desktop.
void multiply1DMatrixIKJ(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 k = 0; k < n; ++k) {
double temp = *(Arow + k);
double *Brow = &B->matrix[k * n];
for (int j = 0; j < n; ++j)
*(Crow + j) += temp * *(Brow + j);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment