pub struct SparseMatrixView<T> {
pub rows: usize,
pub cols: usize,
pub indptr: Vec<usize>,
pub indices: Vec<usize>,
pub data: Vec<T>,
}Expand description
A simple view struct for sparse matrices in CSR format
This struct provides a simple interface to view a sparse matrix in CSR format. It is designed to be compatible with the CSR format used in scirs2-sparse.
Fields§
§rows: usizeNumber of rows
cols: usizeNumber of columns
indptr: Vec<usize>Row pointers (size rows+1)
indices: Vec<usize>Column indices
data: Vec<T>Data values
Implementations§
Trait Implementations§
Source§impl<T: Clone> Clone for SparseMatrixView<T>
impl<T: Clone> Clone for SparseMatrixView<T>
Source§fn clone(&self) -> SparseMatrixView<T>
fn clone(&self) -> SparseMatrixView<T>
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<T: Debug> Debug for SparseMatrixView<T>
impl<T: Debug> Debug for SparseMatrixView<T>
Source§impl<T> SparseLinalg<T> for SparseMatrixView<T>
Blanket implementation for SparseMatrixView
impl<T> SparseLinalg<T> for SparseMatrixView<T>
Blanket implementation for SparseMatrixView
Source§fn to_csr(&self) -> LinalgResult<SparseMatrixView<T>>
fn to_csr(&self) -> LinalgResult<SparseMatrixView<T>>
Convert to CSR format for interoperability
Source§fn matvec(&self, x: &ArrayView1<'_, T>) -> LinalgResult<Array1<T>>
fn matvec(&self, x: &ArrayView1<'_, T>) -> LinalgResult<Array1<T>>
Matrix-vector multiplication
Source§fn solve(&self, b: &ArrayView1<'_, T>) -> LinalgResult<Array1<T>>
fn solve(&self, b: &ArrayView1<'_, T>) -> LinalgResult<Array1<T>>
Solve linear system Ax = b
Source§fn stats(&self) -> SparseMatrixStats
fn stats(&self) -> SparseMatrixStats
Get sparsity statistics
Auto Trait Implementations§
impl<T> Freeze for SparseMatrixView<T>
impl<T> RefUnwindSafe for SparseMatrixView<T>where
T: RefUnwindSafe,
impl<T> Send for SparseMatrixView<T>where
T: Send,
impl<T> Sync for SparseMatrixView<T>where
T: Sync,
impl<T> Unpin for SparseMatrixView<T>where
T: Unpin,
impl<T> UnsafeUnpin for SparseMatrixView<T>
impl<T> UnwindSafe for SparseMatrixView<T>where
T: 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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