pub struct CscMatrix { /* private fields */ }Expand description
A sparse matrix in compressed sparse column format.
Implementations§
Source§impl CscMatrix
impl CscMatrix
Sourcepub fn ldl_symbolic(&self) -> Result<CscLdl, SparseError>
pub fn ldl_symbolic(&self) -> Result<CscLdl, SparseError>
Builds the LDLᵀ factorization pattern symbolically for the fill-reducing ordering, requiring a structurally full diagonal; the values must be symmetric and are all zero until a refactorization supplies them.
Source§impl CscMatrix
impl CscMatrix
Sourcepub fn lu(&self) -> Result<CscLu, SparseError>
pub fn lu(&self) -> Result<CscLu, SparseError>
Factors PA = LU using the Gilbert-Peierls method with partial pivoting.
Sourcepub fn lu_amd(&self) -> Result<CscLu, SparseError>
pub fn lu_amd(&self) -> Result<CscLu, SparseError>
Factors PAQ = LU using the Gilbert-Peierls method with partial pivoting, with a fill-reducing approximate minimum degree column ordering.
Sourcepub fn lu_symbolic(&self) -> Result<CscLu, SparseError>
pub fn lu_symbolic(&self) -> Result<CscLu, SparseError>
Builds the factorization pattern symbolically for the fill-reducing ordering assuming pivots from a maximum transversal (the diagonal when it is structurally full), which is the exact fill pattern for a symmetric pattern and a superset otherwise; all values are zero until a refactorization supplies them.
Source§impl CscMatrix
impl CscMatrix
Sourcepub fn from_pattern(
height: usize,
width: usize,
pattern: Vec<(usize, usize)>,
) -> Self
pub fn from_pattern( height: usize, width: usize, pattern: Vec<(usize, usize)>, ) -> Self
Builds the sparsity structure from a list of nonzero (row, column) positions, with all values initialized to zero.
Sourcepub fn fill(&mut self, source: impl FnMut(usize, usize) -> Scalar)
pub fn fill(&mut self, source: impl FnMut(usize, usize) -> Scalar)
Fills the values from a source, summing duplicate positions in the pattern.
Sourcepub fn column(&self, j: usize) -> impl Iterator<Item = (usize, &Scalar)>
pub fn column(&self, j: usize) -> impl Iterator<Item = (usize, &Scalar)>
Iterates over the nonzero entries of a column as (row, value).
pub fn height(&self) -> usize
Sourcepub fn iter(&self) -> impl Iterator<Item = (usize, usize, &Scalar)>
pub fn iter(&self) -> impl Iterator<Item = (usize, usize, &Scalar)>
Iterates over the nonzero entries as (row, column, value), in column-major order.
pub fn nonzeros(&self) -> usize
Sourcepub fn pattern(&self) -> &[(usize, usize)]
pub fn pattern(&self) -> &[(usize, usize)]
The nonzero (row, column) positions this structure was built from.