Canoe
Comprehensive Atmosphere N' Ocean Engine
mvdot.c
Go to the documentation of this file.
1 #include <assert.h>
7 void mvdot(double *r, double **m, double const *v, int n1, int n2) {
8  assert(r != v); // r and v cannot be the same
9  for (int i = 0; i < n1; ++i) {
10  r[i] = 0.;
11 #pragma GCC ivdep
12  for (int j = 0; j < n2; ++j) r[i] += m[i][j] * v[j];
13  }
14 }
void mvdot(double *r, double **m, double const *v, int n1, int n2)
Definition: mvdot.c:7