Struct faer_core::sparse::SymbolicSparseColMatRef
source · pub struct SymbolicSparseColMatRef<'a, I> { /* private fields */ }Expand description
Symbolic structure of sparse matrix in column format, either compressed or uncompressed.
Requires:
-
nrows <= I::Signed::MAX(always checked) -
ncols <= I::Signed::MAX(always checked) -
col_ptrshas length n (always checked) -
col_ptrsis non-decreasing -
col_ptrs[0]..col_ptrs[n]is a valid range in row_indices (always checked, assuming non-decreasing) -
if
nnz_per_colisNone, elements ofrow_indices[col_ptrs[j]..col_ptrs[j + 1]]are less thannrows -
nnz_per_col[j] <= col_ptrs[j+1] - col_ptrs[j] -
if
nnz_per_colisSome(_), elements ofrow_indices[col_ptrs[j]..][..nnz_per_col[j]]are less thannrows
Implementations§
source§impl<'a, I: Index> SymbolicSparseColMatRef<'a, I>
impl<'a, I: Index> SymbolicSparseColMatRef<'a, I>
sourcepub fn new_checked(
nrows: usize,
ncols: usize,
col_ptrs: &'a [I],
nnz_per_col: Option<&'a [I]>,
row_indices: &'a [I]
) -> Self
pub fn new_checked( nrows: usize, ncols: usize, col_ptrs: &'a [I], nnz_per_col: Option<&'a [I]>, row_indices: &'a [I] ) -> Self
Creates a new symbolic matrix view after asserting its invariants.
Panics
See type level documentation.
sourcepub unsafe fn new_unchecked(
nrows: usize,
ncols: usize,
col_ptrs: &'a [I],
nnz_per_col: Option<&'a [I]>,
row_indices: &'a [I]
) -> Self
pub unsafe fn new_unchecked( nrows: usize, ncols: usize, col_ptrs: &'a [I], nnz_per_col: Option<&'a [I]>, row_indices: &'a [I] ) -> Self
Creates a new symbolic matrix view without asserting its invariants.
Safety
See type level documentation.
sourcepub fn compute_nnz(&self) -> usize
pub fn compute_nnz(&self) -> usize
Returns the number of symbolic non-zeros in the matrix.
The value is guaranteed to be less than I::Signed::MAX.
sourcepub fn nnz_per_col(&self) -> Option<&'a [I]>
pub fn nnz_per_col(&self) -> Option<&'a [I]>
Returns the count of non-zeros per column of the matrix.
sourcepub fn row_indices(&self) -> &'a [I]
pub fn row_indices(&self) -> &'a [I]
Returns the row indices.