[−][src]Function sprs::binop::csmat_binop
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: Num,
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()
Errors
- on incompatible dimensions
- on incomatible storage