LJ Archive

Listing 5.

void matmul0(int dim, float *a, float *b,
   float *c)
  {
     int i, j, k; float dot;
     for (i = 0; i < dim; ++i)
        for (j = 0; j < dim; ++j)
        {
           dot = 0.0;i
           for (k = 0; k < dim; ++k)
              dot += a[i*dim + k] * b[k*dim + j];
           c[i*dim + j] = dot;
        }
  }
LJ Archive