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

pub fn csmat_binop<N, I, Iptr, F>(
    lhs: CsMatViewI<'_, N, I, Iptr>,
    rhs: CsMatViewI<'_, N, I, Iptr>,
    binop: F
) -> CsMatI<N, I, Iptr> where
    N: Zero + PartialEq + Clone,
    I: SpIndex,
    Iptr: 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()

Panics

  • on incompatible dimensions
  • on incomatible storage