Skip to content

"lanes"-like functions from Rust ndarray #153

@goertzenator

Description

@goertzenator

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:

  1. resize n dim array to a 2d array
  2. call innerSlices
  3. map the resulting Ix1 arrays
  4. stack the result back together with stackInnerSlices stackOuterSlices
  5. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions