lanl / spiner

Performance portable routines for generic, tabulated, multi-dimensional data
https://lanl.github.io/spiner
BSD 3-Clause "New" or "Revised" License
7 stars 3 forks source link

[JOSS REVIEW] column-major or row-major? #34

Closed lgarrison closed 2 years ago

lgarrison commented 2 years ago

The docs say that DataBox is ordered column-major. But then the example given is the following:

Spiner::DataBox db(nx3, nx2, nx1);

x3 is the slowest moving index and x1 is the fastest

To me, that's row-major indexing. For example, a NumPy array in C-contiguous order (i.e. row major) is indexed as arr[i, j, k], where i is the slowest index and k is the fastest. This looks like the same ordering of slow-to-fast as DataBox, so doesn't that make it row-major?

x-ref https://github.com/openjournals/joss-reviews/issues/4367

Yurlungur commented 2 years ago

Oops yes you're right. I will fix this. Thanks!