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
It may make sense to refactor out the code that converts linear indices into N-dimensional indices and vice versa into a separate object that could be re-used. See discussion in #47 for background.
The text was updated successfully, but these errors were encountered:
Here's a sketch of the idea I was talking about in #47,
interfaceNDArrayShape {
funshape(): List<T>
}
interfaceNDArrayCursor: NDArrayShape, Collection<Int> {
val linear:Intval pos:IntArray// this would be implemented as lazy by { linearToIdx(linear) }// Collection<Int> would be implemented as calls to pos
}
/// and then codegen a bunch of these so that destructuring worksinterfaceNDArrayCursor1: NDArrayCursor { funcomponent1() }
And then use the NDArrayCursor in places that currently use IntArrays as indices, so that code that only needs linear can use it efficiently, and code that needs the full position can read it without having to compute it itself.
It may make sense to refactor out the code that converts linear indices into N-dimensional indices and vice versa into a separate object that could be re-used. See discussion in #47 for background.
The text was updated successfully, but these errors were encountered: