pub struct SparsityInfo {
pub nnz: usize,
pub dimensions: (DimensionType, DimensionType),
pub sparsity_ratio: Precision,
pub avg_nnz_per_row: Precision,
pub max_nnz_per_row: usize,
pub bandwidth: Option<usize>,
pub is_banded: bool,
}Expand description
Matrix sparsity pattern information.
Fields§
§nnz: usizeTotal number of non-zero elements
dimensions: (DimensionType, DimensionType)Matrix dimensions (rows, cols)
sparsity_ratio: PrecisionSparsity ratio (nnz / (rows * cols))
avg_nnz_per_row: PrecisionAverage number of non-zeros per row
max_nnz_per_row: usizeMaximum number of non-zeros in any row
bandwidth: Option<usize>Bandwidth of the matrix
is_banded: boolWhether the matrix has a banded structure
Implementations§
Source§impl SparsityInfo
impl SparsityInfo
Sourcepub fn new(nnz: usize, rows: DimensionType, cols: DimensionType) -> Self
pub fn new(nnz: usize, rows: DimensionType, cols: DimensionType) -> Self
Create sparsity information from basic matrix data.
Sourcepub fn is_very_sparse(&self) -> bool
pub fn is_very_sparse(&self) -> bool
Check if the matrix is very sparse (< 1% non-zero).
Trait Implementations§
Source§impl Clone for SparsityInfo
impl Clone for SparsityInfo
Source§fn clone(&self) -> SparsityInfo
fn clone(&self) -> SparsityInfo
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SparsityInfo
impl Debug for SparsityInfo
Source§impl<'de> Deserialize<'de> for SparsityInfo
impl<'de> Deserialize<'de> for SparsityInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for SparsityInfo
impl PartialEq for SparsityInfo
Source§impl Serialize for SparsityInfo
impl Serialize for SparsityInfo
impl StructuralPartialEq for SparsityInfo
Auto Trait Implementations§
impl Freeze for SparsityInfo
impl RefUnwindSafe for SparsityInfo
impl Send for SparsityInfo
impl Sync for SparsityInfo
impl Unpin for SparsityInfo
impl UnwindSafe for SparsityInfo
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