Point Five Per Iteration

CS:APP analyses the six loop orderings of an N×NN \times N double matrix multiply under one set of assumptions: 32-byte lines (four doubles), NN large enough that 1/N≈01/N \approx 0, and a cache too small to hold multiple rows. Two rows of the result are filled in:

order inner-loop access pattern misses per inner iteration
ijk A row-wise, B column-wise, C fixed 1.25
jki A column-wise, B fixed, C column-wise 2.00
kij A fixed, B row-wise, C row-wise ?
/* kij */
for (k = 0; k < n; k++) {
  for (i = 0; i < n; i++) {
    r = a[i][k];
    for (j = 0; j < n; j++)
      c[i][j] += r * b[k][j];
  }
}

What goes in the missing cell?

A

2.25, because kij writes to C on every iteration as well as reading B

B

0.50

C

0.25, because only B is read from memory in the inner loop

D

1.00