pub struct CsrMatrix {
pub row_offsets: Vec<usize>,
pub col_indices: Vec<usize>,
pub values: Vec<f64>,
pub n_rows: usize,
pub n_cols: usize,
}Expand description
Compressed Sparse Row storage for adjacency matrices.
Fields§
§row_offsets: Vec<usize>Length n_rows + 1. row_offsets[i]..row_offsets[i+1] indexes into col_indices/values.
col_indices: Vec<usize>§values: Vec<f64>§n_rows: usize§n_cols: usizeImplementations§
Source§impl CsrMatrix
impl CsrMatrix
pub fn new( row_offsets: Vec<usize>, col_indices: Vec<usize>, values: Vec<f64>, n_rows: usize, n_cols: usize, ) -> Result<Self, String>
pub fn nnz(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CsrMatrix
impl RefUnwindSafe for CsrMatrix
impl Send for CsrMatrix
impl Sync for CsrMatrix
impl Unpin for CsrMatrix
impl UnsafeUnpin for CsrMatrix
impl UnwindSafe for CsrMatrix
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