Skip to content

map_axis with FnMut(ArrayViewMut1<'a, A>) #452

Closed
@LukeMathWalker

Description

@LukeMathWalker

Currently map_axis accepts only a mapping taking as argument a 1-dimensional ArrayView (https://docs.rs/ndarray/0.11.2/ndarray/struct.ArrayBase.html#method.map_axis).
What if I wanted to use a function that takes an ArrayViewMut1 as argument?

Is there another way to achieve the effect of map_axis using other iterators/Zip/etc.?
I have tried to reason around that but I have not yet been able to come up with a solution...

The use-case I have in mind is a reducer that takes a lane in the array as argument and applies a function that modifies the one-dimensional array in place to return a single value for each lane.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions