extendr_api::prelude::sparse::ops

Function ternary_op_assign_into

pub fn ternary_op_assign_into<I, E, LhsE, RhsE>(
    dst: SparseColMatMut<'_, I, E>,
    lhs: SparseColMatRef<'_, I, LhsE>,
    rhs: SparseColMatRef<'_, I, RhsE>,
    f: impl FnMut(E, LhsE, RhsE) -> E,
)
where I: Index, E: Entity, LhsE: Entity, RhsE: Entity,
Expand description

Returns the resulting matrix obtained by applying f to the elements from dst, lhs and rhs, skipping entries that are unavailable in all of dst, lhs and rhs.
The sparsity patter of dst is unchanged.

§Panics

Panics if lhs, rhs and dst don’t have matching dimensions.
Panics if lhs or rhs contains an index that’s unavailable in dst.