pub struct SparseColMatRef<'a, I, E: Entity> { /* private fields */ }
Expand description

Sparse matrix in column format, either compressed or uncompressed.

Implementations§

source§

impl<'a, I: Index, E: Entity> SparseColMatRef<'a, I, E>

source

pub fn new( symbolic: SymbolicSparseColMatRef<'a, I>, values: GroupFor<E, &'a [E::Unit]> ) -> Self

Creates a new sparse matrix view.

Panics

Panics if the length of values is not equal to the length of symbolic.row_indices().

source

pub fn values(&self) -> GroupFor<E, &'a [E::Unit]>

Returns the numerical values of the matrix.

source

pub fn values_of_col(&self, j: usize) -> GroupFor<E, &'a [E::Unit]>

Returns the numerical values of column j of the matrix.

Panics:

Panics if j >= n.

source

pub fn symbolic(&self) -> SymbolicSparseColMatRef<'a, I>

Returns the symbolic structure of the matrix.

Methods from Deref<Target = SymbolicSparseColMatRef<'a, I>>§

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, E: Entity> Clone for SparseColMatRef<'_, I, E>

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, E: Debug + Entity> Debug for SparseColMatRef<'a, I, E>

source§

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

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

impl<'a, I, E: Entity> Deref for SparseColMatRef<'a, I, E>

§

type Target = SymbolicSparseColMatRef<'a, I>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<I, E: Entity> Copy for SparseColMatRef<'_, I, E>

Auto Trait Implementations§

§

impl<'a, I, E> RefUnwindSafe for SparseColMatRef<'a, I, E>
where I: RefUnwindSafe, <<E as Entity>::Group as ForCopyType>::FaerOfCopy<&'static [<E as Entity>::Unit]>: RefUnwindSafe,

§

impl<'a, I, E> Send for SparseColMatRef<'a, I, E>
where I: Sync, <<E as Entity>::Group as ForCopyType>::FaerOfCopy<&'static [<E as Entity>::Unit]>: Send,

§

impl<'a, I, E> Sync for SparseColMatRef<'a, I, E>
where I: Sync, <<E as Entity>::Group as ForCopyType>::FaerOfCopy<&'static [<E as Entity>::Unit]>: Sync,

§

impl<'a, I, E> Unpin for SparseColMatRef<'a, I, E>
where <<E as Entity>::Group as ForCopyType>::FaerOfCopy<&'static [<E as Entity>::Unit]>: Unpin,

§

impl<'a, I, E> UnwindSafe for SparseColMatRef<'a, I, E>
where I: RefUnwindSafe, <<E as Entity>::Group as ForCopyType>::FaerOfCopy<&'static [<E as Entity>::Unit]>: UnwindSafe,

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.