pub struct SparseMatrix { /* private fields */ }Expand description
Validated compressed-sparse-row matrix.
Implementations§
Source§impl SparseMatrix
impl SparseMatrix
pub fn new( rows: usize, columns: usize, indptr: Vec<usize>, indices: Vec<usize>, values: Vec<f64>, ) -> Result<Self>
pub fn from_dense(dense: ArrayView2<'_, f64>) -> Result<Self>
pub fn nrows(&self) -> usize
pub fn ncols(&self) -> usize
pub fn nnz(&self) -> usize
pub fn indptr(&self) -> &[usize]
pub fn indices(&self) -> &[usize]
pub fn values(&self) -> &[f64]
pub fn validate(&self) -> Result<()>
pub fn row(&self, row: usize) -> Result<SparseRowView<'_>>
pub fn to_dense(&self) -> Result<Array2<f64>>
Trait Implementations§
Source§impl Clone for SparseMatrix
impl Clone for SparseMatrix
Source§fn clone(&self) -> SparseMatrix
fn clone(&self) -> SparseMatrix
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SparseMatrix
impl Debug for SparseMatrix
Source§impl<'de> Deserialize<'de> for SparseMatrix
impl<'de> Deserialize<'de> for SparseMatrix
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for SparseMatrix
impl PartialEq for SparseMatrix
Source§impl Serialize for SparseMatrix
impl Serialize 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