pub struct SparseMatrix<F> { /* private fields */ }Expand description
A sparse matrix implementation using the Compressed Sparse Row (CSR) format.
Implementations§
Source§impl<F: Field> SparseMatrix<F>
impl<F: Field> SparseMatrix<F>
Sourcepub fn new(
row_offsets: Vec<usize>,
col_indices: Vec<usize>,
values: Vec<F>,
num_cols: usize,
) -> Self
pub fn new( row_offsets: Vec<usize>, col_indices: Vec<usize>, values: Vec<F>, num_cols: usize, ) -> Self
Creates a new sparse matrix from its CSR components.
Sourcepub fn new_rows_cols(num_rows: usize, num_cols: usize) -> SparseMatrix<F>
pub fn new_rows_cols(num_rows: usize, num_cols: usize) -> SparseMatrix<F>
Creates an empty sparse matrix with the specified dimensions.
Trait Implementations§
Source§impl<F: Clone> Clone for SparseMatrix<F>
impl<F: Clone> Clone for SparseMatrix<F>
Source§fn clone(&self) -> SparseMatrix<F>
fn clone(&self) -> SparseMatrix<F>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<F: Debug> Debug for SparseMatrix<F>
impl<F: Debug> Debug for SparseMatrix<F>
Source§impl<F: Default> Default for SparseMatrix<F>
impl<F: Default> Default for SparseMatrix<F>
Source§fn default() -> SparseMatrix<F>
fn default() -> SparseMatrix<F>
Returns the “default value” for a type. Read more
Source§impl<F: Field> Mul<&SparseMatrix<F>> for &SparseMatrix<F>
impl<F: Field> Mul<&SparseMatrix<F>> for &SparseMatrix<F>
Source§fn mul(self, rhs: &SparseMatrix<F>) -> Self::Output
fn mul(self, rhs: &SparseMatrix<F>) -> Self::Output
Source§type Output = SparseMatrix<F>
type Output = SparseMatrix<F>
The resulting type after applying the
* operator.Source§impl<F: PartialEq> PartialEq for SparseMatrix<F>
impl<F: PartialEq> PartialEq for SparseMatrix<F>
impl<F: Eq> Eq for SparseMatrix<F>
impl<F> StructuralPartialEq for SparseMatrix<F>
Auto Trait Implementations§
impl<F> Freeze for SparseMatrix<F>
impl<F> RefUnwindSafe for SparseMatrix<F>where
F: RefUnwindSafe,
impl<F> Send for SparseMatrix<F>where
F: Send,
impl<F> Sync for SparseMatrix<F>where
F: Sync,
impl<F> Unpin for SparseMatrix<F>where
F: Unpin,
impl<F> UnwindSafe for SparseMatrix<F>where
F: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more