[][src]Function sprs::binop::csvec_binop

pub fn csvec_binop<N, I, F>(
    lhs: CsVecViewI<N, I>,
    rhs: CsVecViewI<N, I>,
    binop: F
) -> SpRes<CsVecI<N, I>> where
    N: Num,
    F: Fn(&N, &N) -> N,
    I: SpIndex

Binary operations for CsVec

This function iterates the non-zero locations of lhs and rhs and applies the function binop to the matching elements (defaulting to zero when e.g. only lhs has a non-zero at a given location).

The function thus has a correct behavior iff binop(0, 0) == 0.