Function beagle::scalar_array::fold [] [src]

pub fn fold<S, F0, F, O>(s: S, f0: F0, f: F) -> O where
    S: ScalarArrayVal,
    F0: FnOnce(S::Scalar) -> O,
    F: FnMut(O, S::Scalar) -> O,
    <S::Row as HasSmaller>::Smaller: Array<S::Scalar>,
    <S::Dim as HasSmaller>::Smaller: Array<<S::Row as Array<S::Scalar>>::Type>, 

Fold all the scalars in a ScalarArray. The first element is mapped with f0, then folding continues with f for other elements.