Skip to content

Cumulative map #506

Open
Open
@sebasv

Description

@sebasv

Like numpy.cumsum() or numpy.cumprod() but with map, mapv, map_inplace, map_into since unlike Numpy, in Rust we don't take a performance hit by supplying user functions. I imagine the signature to be something like

fn cum_mapv<F: Fn(T,T) -> T>(&self<T>, f: F) -> Self// T being the element type

// cumsum example:
let a = Array::linspace(0., 100., 100).cummapv(|acc, cur| acc + cur);

If this will be considered for inclusion, I can write up a PR!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions