DataOrientedDesign
DataOrientedDesign copied to clipboard
Rows vs Cols indexing
Two dimensional array access should be similar to:
array[(rowIndex * columnCount) + columnIndex]
But for example: https://github.com/badamczewski/DataOrientedDesign/blob/49c1a08606078737c85ec754ddfd90f5b25bbc17/DoDSamples/Samples/Benchmarks/RowsVsCols.cs#L33-L39
which is
array[(columnIndex * columnCount) + rowIndex]
The results seem to be aligned with your course outline because one of them is using the outer loop index while other uses the inner loop. But that will need a fix when you have different column and row counts. It is useful to have different counts, if you want to keep the array size same and increase column size to see the effect of different levels of cache.
You are right, I will update the sample.