I’m trying to understand the semantics of dense vs. strided arrays in Julia (in the Base
array types).
In my mind, there are three types of “regular” matrices:
-
Strided: offset in memory of element (i, j) is (a + b * i + c * j)
-
Striped (for lack of a better term): Strided, but either b or c are equal to the size of the element, that is, each complete stripe (column or row) is contiguous in memory, but there may be a gap between stripes (columns or rows).
-
Dense: Striped, but where there is no gap between stripes (so the whole memory footprint of the array is contiguous).
These concepts apply to higher dimensions - strided and dense are obvious, and for “Striped”, one could say how many dimensions are in a stripe (at least 1 and at most 1 less than the number of dimensions, otherwise the data would be “Dense”).
Julia has DenseArray
which is an abstract type which I think maps to the “Dense” concept above.
Julia also has StridedArray
which (alas) is a union of concrete types, which seems to map to the “Strided” concept above.
Julia doesn’t have anything like the “Striped” concept above.
Is that a fair summary of the state of affairs?