Skip to content

Instantly share code, notes, and snippets.

@pubudu91
Created Nov 10, 2016
Embed
What would you like to do?
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