RecursiveArrayTools.jl icon indicating copy to clipboard operation
RecursiveArrayTools.jl copied to clipboard

Choice of memory layout for VectorOfArray

Open muendlein opened this issue 1 year ago • 1 comments

From the docs:

A[i] # Returns the ith array in the vector of arrays
A[j, i] # Returns the jth component in the ith array
A[j1, ..., jN, i] # Returns the (j1,...,jN) component of the ith array

which presents itself as a column-major matrix with the columns being the arrays from the vector.

What is the reasoning behind this memory layout? Can one use a tranposed memory layout, i.e. each component is represented by a column? What are the performance implications when trying to access A[j1, :] for max(i) >> max(j), i.e. timeseries data?

Perhaps the answers to those questions should be included in the docs.

muendlein avatar Mar 25 '23 00:03 muendlein

The reasoning is just that it's the column-major form and Julia's matrices are column major.

ChrisRackauckas avatar Mar 25 '23 00:03 ChrisRackauckas