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_ptrs has length n (always checked)

  • col_ptrs is non-decreasing

  • col_ptrs[0]..col_ptrs[n] is a valid range in row_indices (always checked, assuming non-decreasing)

  • if nnz_per_col is None, elements of row_indices[col_ptrs[j]..col_ptrs[j + 1]] are less than nrows

  • nnz_per_col[j] <= col_ptrs[j+1] - col_ptrs[j]

  • if nnz_per_col is Some(_), elements of row_indices[col_ptrs[j]..][..nnz_per_col[j]] are less than nrows

Implementations§

source§

impl<'a, I: Index> SymbolicSparseColMatRef<'a, I>

source

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.

source

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.

source

pub fn nrows(&self) -> usize

Returns the number of rows of the matrix.

source

pub fn ncols(&self) -> usize

Returns the number of columns of the matrix.

source

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.

source

pub fn col_ptrs(&self) -> &'a [I]

Returns the column pointers.

source

pub fn nnz_per_col(&self) -> Option<&'a [I]>

Returns the count of non-zeros per column of the matrix.

source

pub fn row_indices(&self) -> &'a [I]

Returns the row indices.

source

pub fn row_indices_of_col_raw(&self, j: usize) -> &'a [I]

Returns the row indices of column j.

Panics

Panics if j >= self.ncols()

source

pub fn row_indices_of_col( &self, j: usize ) -> impl 'a + ExactSizeIterator + DoubleEndedIterator<Item = usize>

Returns the row indices of column j.

Panics

Panics if j >= self.ncols()

source

pub fn col_range(&self, j: usize) -> Range<usize>

Returns the range that the column j occupies in `self.row_indices().

Panics

Panics if j >= self.ncols()

source

pub unsafe fn col_range_unchecked(&self, j: usize) -> Range<usize>

Returns the range that the column j occupies in `self.row_indices().

Safety

The behavior is undefined if j >= self.ncols()

Trait Implementations§

source§

impl<I> Clone for SymbolicSparseColMatRef<'_, I>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a, I: Debug> Debug for SymbolicSparseColMatRef<'a, I>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<I> Copy for SymbolicSparseColMatRef<'_, I>

Auto Trait Implementations§

§

impl<'a, I> RefUnwindSafe for SymbolicSparseColMatRef<'a, I>
where I: RefUnwindSafe,

§

impl<'a, I> Send for SymbolicSparseColMatRef<'a, I>
where I: Sync,

§

impl<'a, I> Sync for SymbolicSparseColMatRef<'a, I>
where I: Sync,

§

impl<'a, I> Unpin for SymbolicSparseColMatRef<'a, I>

§

impl<'a, I> UnwindSafe for SymbolicSparseColMatRef<'a, I>
where I: RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.