Struct faer_core::sparse::SymbolicSparseRowMatRef
source · pub struct SymbolicSparseRowMatRef<'a, I> { /* private fields */ }Expand description
Symbolic structure of sparse matrix in row format, either compressed or uncompressed.
Requires:
-
nrows <= I::Signed::MAX(always checked) -
ncols <= I::Signed::MAX(always checked) -
row_ptrshas lengthnrows + 1(always checked) -
row_ptrsis non-decreasing -
row_ptrs[0]..row_ptrs[nrows]is a valid range in row_indices (always checked, assuming non-decreasing) -
if
nnz_per_rowisNone, elements ofcol_indices[row_ptrs[i]..row_ptrs[i + 1]]are less thanncols -
nnz_per_row[i] <= row_ptrs[i+1] - row_ptrs[i] -
if
nnz_per_rowisSome(_), elements ofcol_indices[row_ptrs[i]..][..nnz_per_row[i]]are less thanncols
Implementations§
source§impl<'a, I: Index> SymbolicSparseRowMatRef<'a, I>
impl<'a, I: Index> SymbolicSparseRowMatRef<'a, I>
sourcepub fn new_checked(
nrows: usize,
ncols: usize,
row_ptrs: &'a [I],
nnz_per_row: Option<&'a [I]>,
col_indices: &'a [I]
) -> Self
pub fn new_checked( nrows: usize, ncols: usize, row_ptrs: &'a [I], nnz_per_row: Option<&'a [I]>, col_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,
row_ptrs: &'a [I],
nnz_per_row: Option<&'a [I]>,
col_indices: &'a [I]
) -> Self
pub unsafe fn new_unchecked( nrows: usize, ncols: usize, row_ptrs: &'a [I], nnz_per_row: Option<&'a [I]>, col_indices: &'a [I] ) -> Self
Creates a new symbolic matrix view without asserting its invariants.
Safety
See type level documentation.
pub fn transpose(self) -> SymbolicSparseColMatRef<'a, I>
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_row(&self) -> Option<&'a [I]>
pub fn nnz_per_row(&self) -> Option<&'a [I]>
Returns the count of non-zeros per column of the matrix.
sourcepub fn col_indices(&self) -> &'a [I]
pub fn col_indices(&self) -> &'a [I]
Returns the column indices.