#[non_exhaustive]pub struct CscMatrix { /* private fields */ }Expand description
Compressed Sparse Column matrix.
Efficient for column iteration (tree fit, linear algebra).
indptr[j]..indptr[j+1] gives the range for column j.
Implementations§
Source§impl CscMatrix
impl CscMatrix
Sourcepub fn from_triplets(
rows: &[usize],
cols: &[usize],
vals: &[f64],
n_rows: usize,
n_cols: usize,
) -> Result<Self>
pub fn from_triplets( rows: &[usize], cols: &[usize], vals: &[f64], n_rows: usize, n_cols: usize, ) -> Result<Self>
Build a CSC matrix from COO (triplet) format.
Duplicate entries at the same (row, col) are summed.
Sourcepub fn from_dense(cols: &[Vec<f64>]) -> Self
pub fn from_dense(cols: &[Vec<f64>]) -> Self
Convert a column-major dense matrix to CSC (zeros are skipped).
cols[j][i] = value at row i, column j.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CscMatrix
impl RefUnwindSafe for CscMatrix
impl Send for CscMatrix
impl Sync for CscMatrix
impl Unpin for CscMatrix
impl UnsafeUnpin for CscMatrix
impl UnwindSafe for CscMatrix
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