pub struct SparseMatrix { /* private fields */ }Expand description
A sparse matrix in compressed sparse row form.
Rows are stored in order and the column indices within each row are strictly increasing, so two matrices built from the same entries in any order are equal and every product is computed in the same order.
Implementations§
Source§impl SparseMatrix
impl SparseMatrix
Sourcepub fn from_triplets(
rows: usize,
cols: usize,
triplets: &[(usize, usize, f64)],
) -> NumericResult<Self>
pub fn from_triplets( rows: usize, cols: usize, triplets: &[(usize, usize, f64)], ) -> NumericResult<Self>
Build from (row, column, value) triplets. Entries naming the same
position are summed, in the order given; entries that sum to zero are
kept as explicit zeros.
§Errors
NumericError::InvalidArgument for a triplet outside the
rows x cols shape and NumericError::NonFiniteInput for a
non-finite value.
Trait Implementations§
Source§impl Clone for SparseMatrix
impl Clone for SparseMatrix
Source§impl Debug for SparseMatrix
impl Debug for SparseMatrix
Source§impl PartialEq for SparseMatrix
impl PartialEq for SparseMatrix
impl StructuralPartialEq for SparseMatrix
Auto Trait Implementations§
impl Freeze for SparseMatrix
impl RefUnwindSafe for SparseMatrix
impl Send for SparseMatrix
impl Sync for SparseMatrix
impl Unpin for SparseMatrix
impl UnsafeUnpin for SparseMatrix
impl UnwindSafe for SparseMatrix
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more