[][src]Function sprs::binop::csmat_binop

pub fn csmat_binop<N, I, F>(
    lhs: CsMatViewI<N, I>,
    rhs: CsMatViewI<N, I>,
    binop: F
) -> CsMatI<N, I> where
    N: Num,
    I: SpIndex,
    F: Fn(&N, &N) -> N, 

Applies a binary operation to matching non-zero elements of two sparse matrices. When e.g. only the lhs has a non-zero at a given location, 0 is inferred for the non-zero value of the other matrix. Both matrices should have the same storage.

Thus the behaviour is correct iff binop(N::zero(), N::zero()) == N::zero()

Errors

  • on incompatible dimensions
  • on incomatible storage