Next: Interchange loops Up: Chapter1 Previous: If you want to play...

Accumulate into a scalar

  for (i = 0; i < 500; i++)
    for (j = 0; j < 500; j++){
      r = 0.0;
      for (k = 0; k < 500; k++){
        r += A[i][k] * B[k][j];
      }
      C[i][j] = r;
    }


Paul H J Kelly Thu Feb 6 22:02:49 GMT 1997