[][src]Trait ndarray_stats::MaybeNanExt

pub trait MaybeNanExt<A, S, D> where
    A: MaybeNan,
    S: Data<Elem = A>,
    D: Dimension
{ pub fn fold_skipnan<'a, F, B>(&'a self, init: B, f: F) -> B
    where
        A: 'a,
        F: FnMut(B, &'a A::NotNan) -> B
;
pub fn indexed_fold_skipnan<'a, F, B>(&'a self, init: B, f: F) -> B
    where
        A: 'a,
        F: FnMut(B, (D::Pattern, &'a A::NotNan)) -> B
;
pub fn visit_skipnan<'a, F>(&'a self, f: F)
    where
        A: 'a,
        F: FnMut(&'a A::NotNan)
;
pub fn fold_axis_skipnan<B, F>(
        &self,
        axis: Axis,
        init: B,
        fold: F
    ) -> Array<B, D::Smaller>
    where
        D: RemoveAxis,
        F: FnMut(&B, &A::NotNan) -> B,
        B: Clone
;
pub fn map_axis_skipnan_mut<'a, B, F>(
        &'a mut self,
        axis: Axis,
        mapping: F
    ) -> Array<B, D::Smaller>
    where
        A: 'a,
        S: DataMut,
        D: RemoveAxis,
        F: FnMut(ArrayViewMut1<'a, A::NotNan>) -> B
;
pub fn __private__(&self, _: PrivateMarker); }

Extension trait for ArrayBase providing NaN-related functionality.

Required methods

pub fn fold_skipnan<'a, F, B>(&'a self, init: B, f: F) -> B where
    A: 'a,
    F: FnMut(B, &'a A::NotNan) -> B, 
[src]

Traverse the non-NaN array elements and apply a fold, returning the resulting value.

Elements are visited in arbitrary order.

pub fn indexed_fold_skipnan<'a, F, B>(&'a self, init: B, f: F) -> B where
    A: 'a,
    F: FnMut(B, (D::Pattern, &'a A::NotNan)) -> B, 
[src]

Traverse the non-NaN elements and their indices and apply a fold, returning the resulting value.

Elements are visited in arbitrary order.

pub fn visit_skipnan<'a, F>(&'a self, f: F) where
    A: 'a,
    F: FnMut(&'a A::NotNan), 
[src]

Visit each non-NaN element in the array by calling f on each element.

Elements are visited in arbitrary order.

pub fn fold_axis_skipnan<B, F>(
    &self,
    axis: Axis,
    init: B,
    fold: F
) -> Array<B, D::Smaller> where
    D: RemoveAxis,
    F: FnMut(&B, &A::NotNan) -> B,
    B: Clone
[src]

Fold non-NaN values along an axis.

Combine the non-NaN elements of each subview with the previous using the fold function and initial value init.

pub fn map_axis_skipnan_mut<'a, B, F>(
    &'a mut self,
    axis: Axis,
    mapping: F
) -> Array<B, D::Smaller> where
    A: 'a,
    S: DataMut,
    D: RemoveAxis,
    F: FnMut(ArrayViewMut1<'a, A::NotNan>) -> B, 
[src]

Reduce the values along an axis into just one value, producing a new array with one less dimension.

The NaN values are removed from the 1-dimensional lanes, then they are passed as mutable views to the reducer, allowing for side-effects.

Warnings:

  • The lanes are visited in arbitrary order.

  • The order of the elements within the lanes is unspecified. However, if mapping is idempotent, this method is idempotent. Additionally, given the same input data, the lane is always ordered the same way.

Panics if axis is out of bounds.

pub fn __private__(&self, _: PrivateMarker)[src]

This method makes this trait impossible to implement outside of ndarray-stats so that we can freely add new methods, etc., to this trait without breaking changes.

We don't anticipate any other crates needing to implement this trait, but if you do have such a use-case, please let us know.

Warning This method is not considered part of the public API, and client code should not rely on it being present. It may be removed in a non-breaking release.

Loading content...

Implementations on Foreign Types

impl<A, S, D> MaybeNanExt<A, S, D> for ArrayBase<S, D> where
    A: MaybeNan,
    S: Data<Elem = A>,
    D: Dimension
[src]

Loading content...

Implementors

Loading content...