pub struct CscMatrix {
pub n_rows: usize,
pub n_cols: usize,
pub col_ptr: Vec<usize>,
pub rows: Vec<usize>,
pub vals: Vec<f64>,
}Expand description
Sparse matrix in CSC (compressed sparse column) format.
Mirrors scipy csc_matrix as used by Python sectionproperties’
warping solver (assemble_torsion returns k_lg in CSC form).
Fields§
§n_rows: usize§n_cols: usize§col_ptr: Vec<usize>Column offsets, length n_cols + 1.
rows: Vec<usize>Row indices sorted within each column.
vals: Vec<f64>Nonzero values, column-major.
Implementations§
Source§impl CscMatrix
impl CscMatrix
Sourcepub fn from_csr(
n_rows: usize,
n_cols: usize,
row_ptr: &[usize],
csr_cols: &[usize],
csr_vals: &[f64],
) -> Self
pub fn from_csr( n_rows: usize, n_cols: usize, row_ptr: &[usize], csr_cols: &[usize], csr_vals: &[f64], ) -> Self
Build a CSC matrix from CSR data, summing duplicates
(mirrors csr_matrix(...).tocsc()).
Trait Implementations§
Auto Trait Implementations§
impl Forget for CscMatrix
impl Freeze for CscMatrix
impl Move 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