You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when you're creating a Data::grid() you need to pass a pointer to a pre-existing array with data. If the original data are in a format that's not an array layout, then that's no good.
In that case, you need to allocate some memory, copy (or gather, or whatever) the data in there in the right order, and then create your Data object. But now if you want to return that Data object from a function that created it, you'll have to return some other object owning the memory along with it, and that's annoying.
So it would be nice if we could have a Data::grid() that doesn't take a data pointer but only type, indexes and storage order, and that would allocate the memory internally and own it.
If we make a non-const version of the accessor functions in #251, then that can be used to write in the values.
The text was updated successfully, but these errors were encountered:
Currently, when you're creating a
Data::grid()
you need to pass a pointer to a pre-existing array with data. If the original data are in a format that's not an array layout, then that's no good.In that case, you need to allocate some memory, copy (or gather, or whatever) the data in there in the right order, and then create your
Data
object. But now if you want to return thatData
object from a function that created it, you'll have to return some other object owning the memory along with it, and that's annoying.So it would be nice if we could have a
Data::grid()
that doesn't take a data pointer but only type, indexes and storage order, and that would allocate the memory internally and own it.If we make a non-const version of the accessor functions in #251, then that can be used to write in the values.
The text was updated successfully, but these errors were encountered: