massiv has the slicing functions outerSlices, innerSlices, and withinSlices that return Array D Ix1 (Array D (Lower ix) e). I would like to have functions that provide the opposite: Array D (Lower ix) (Array D Ix1 e).
Some means to stack them back together would be useful, along with maps and zips that operate on Ix1 "lanes" in an Array.
Rust ndarray has functions like this named rows(), columns(), and lanes().
My current need is to operate on inner Ix1 "lanes" to multiply them by a Ix1 window function. I have been able to do this by the following sequence:
resize n dim array to a 2d array
- call
innerSlices
- map the resulting Ix1 arrays
- stack the result back together with
stackInnerSlices stackOuterSlices
resize the array back to its original dimension
I think this approach is only good for the inner dimension, not outer or within dimensions.
If there is a simpler approach using existing massiv functions I would be happy to hear it.
massiv has the slicing functions
outerSlices,innerSlices, andwithinSlicesthat returnArray D Ix1 (Array D (Lower ix) e). I would like to have functions that provide the opposite:Array D (Lower ix) (Array D Ix1 e).Some means to stack them back together would be useful, along with maps and zips that operate on Ix1 "lanes" in an Array.
Rust ndarray has functions like this named
rows(),columns(), andlanes().My current need is to operate on inner Ix1 "lanes" to multiply them by a Ix1 window function. I have been able to do this by the following sequence:
resizen dim array to a 2d arrayinnerSlicesstackInnerSlicesstackOuterSlicesresizethe array back to its original dimensionI think this approach is only good for the inner dimension, not outer or within dimensions.
If there is a simpler approach using existing massiv functions I would be happy to hear it.