SparseRowMatRef

Type Alias SparseRowMatRef 

Source
pub type SparseRowMatRef<'a, I, T, Rows = usize, Cols = usize> = SparseRowMat<Ref<'a, I, T, Rows, Cols>>;
Expand description

view over sparse row major matrix

see SymbolicSparseRowMatRef

Aliased Type§

#[repr(transparent)]
pub struct SparseRowMatRef<'a, I, T, Rows = usize, Cols = usize>(pub Ref<'a, I, T, Rows, Cols>);

Tuple Fields§

§0: Ref<'a, I, T, Rows, Cols>

Implementations§

Source§

impl<'a, Rows: Shape, Cols: Shape, I: Index, T> SparseRowMatRef<'a, I, T, Rows, Cols>

Source

pub fn new( symbolic: SymbolicSparseRowMatRef<'a, I, Rows, Cols>, val: &'a [T], ) -> Self

creates a new sparse matrix view.

§panics

panics if the length of values is not equal to the length of symbolic.col_idx()

Source

pub fn parts(self) -> (SymbolicSparseRowMatRef<'a, I, Rows, Cols>, &'a [T])

returns the symbolic and numeric components of the sparse matrix

Source

pub fn symbolic(&self) -> SymbolicSparseRowMatRef<'a, I, Rows, Cols>

returns the symbolic component of the sparse matrix

Source

pub fn val(self) -> &'a [T]

returns the numeric component of the sparse matrix

Source

pub fn val_of_row(self, i: Idx<Rows>) -> &'a [T]

returns a view over the values of row i

Source

pub fn as_shape<V: Shape, H: Shape>( self, nrows: V, ncols: H, ) -> SparseRowMatRef<'a, I, T, V, H>

returns the input matrix with the given shape after checking that it matches the current shape

Source

pub fn get(self, row: Idx<Rows>, col: Idx<Cols>) -> Option<&'a T>

returns a reference to the value at the given index, or None if the symbolic structure doesn’t contain it, or contains multiple indices with the given index

§panics
  • panics if row >= self.nrows()
  • panics if col >= self.ncols()
Source

pub fn as_dyn(self) -> SparseRowMatRef<'a, I, T>

returns the input matrix with dynamic shape

Source

pub fn as_ref(self) -> SparseRowMatRef<'a, I, T, Rows, Cols>

returns a view over self

Source

pub fn transpose(self) -> SparseColMatRef<'a, I, T, Cols, Rows>

returns a view over the transpose of self

Source

pub fn conjugate(self) -> SparseRowMatRef<'a, I, T::Conj, Rows, Cols>
where T: Conjugate,

returns a view over the conjugate of self

Source

pub fn adjoint(self) -> SparseColMatRef<'a, I, T::Conj, Cols, Rows>
where T: Conjugate,

returns a view over the adjoint of self

Source

pub fn canonical(self) -> SparseRowMatRef<'a, I, T::Canonical, Rows, Cols>
where T: Conjugate,

returns an unconjugated view over self

Source

pub fn to_col_major( &self, ) -> Result<SparseColMat<I, T::Canonical, Rows, Cols>, FaerError>
where T: Conjugate,

returns a newly allocated matrix holding the (possibly conjugated) values of self in column major format

Source

pub fn to_dense(&self) -> Mat<T::Canonical, Rows, Cols>
where T: Conjugate,

returns a newly allocated dense matrix holding the (possibly conjugated) values of self

Source

pub fn triplet_iter( self, ) -> impl 'a + Iterator<Item = Triplet<Idx<Rows>, Idx<Cols>, &'a T>>
where Rows: 'a, Cols: 'a,

returns an iterator over the entries of the matrix.

Methods from Deref<Target = SymbolicSparseRowMatRef<'a, I, Rows, Cols>>§

Source

pub fn nrows(&self) -> Rows

returns the number of rows of the matrix

Source

pub fn ncols(&self) -> Cols

returns the number of columns of the matrix

Source

pub fn shape(&self) -> (Rows, Cols)

returns the number of rows and columns of the matrix

Source

pub fn to_owned(&self) -> Result<SymbolicSparseRowMat<I, Rows, Cols>, FaerError>

returns a newly allocated matrix holding the values of self

Source

pub fn to_col_major( &self, ) -> Result<SymbolicSparseColMat<I, Rows, Cols>, FaerError>

returns a newly allocated matrix holding the values of self in column major format

Source

pub fn compute_nnz(&self) -> usize

returns the number of non-zero elements in the matrix

Source

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

returns the row pointers

Source

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

returns the row non-zero counts

Source

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

returns the column indices

Source

pub fn row_range(&self, i: Idx<Rows>) -> Range<usize>

returns the range specifying the indices of row i

Source

pub unsafe fn row_range_unchecked(&self, i: Idx<Rows>) -> Range<usize>

returns the range specifying the indices of row i, without bound checks

Source

pub fn col_idx_of_row_raw(&self, i: Idx<Rows>) -> &'a [Idx<Cols, I>]

returns the column indices of row i

Source

pub fn col_idx_of_row( &self, i: Idx<Rows>, ) -> impl 'a + Clone + ExactSizeIterator + DoubleEndedIterator<Item = Idx<Cols>>
where Rows: 'a, Cols: 'a,

returns the column indices of row i

Source

pub fn parts(&self) -> (Rows, Cols, &[I], Option<&[I]>, &[I])

Source

pub fn nrows(&self) -> Rows

Source

pub fn ncols(&self) -> Cols

Source

pub fn shape(&self) -> (Rows, Cols)

Source

pub fn transpose(&self) -> SymbolicSparseColMatRef<'_, I, Cols, Rows>

Source

pub fn to_owned(&self) -> Result<SymbolicSparseRowMat<I, Rows, Cols>, FaerError>

Source

pub fn to_col_major( &self, ) -> Result<SymbolicSparseColMat<I, Rows, Cols>, FaerError>

Source

pub fn compute_nnz(&self) -> usize

Source

pub fn row_ptr(&self) -> &[I]

Source

pub fn row_nnz(&self) -> Option<&[I]>

Source

pub fn col_idx(&self) -> &[I]

Source

pub fn row_range(&self, i: Idx<Rows>) -> Range<usize>

Source

pub unsafe fn row_range_unchecked(&self, i: Idx<Rows>) -> Range<usize>

Source

pub fn col_idx_of_row_raw(&self, i: Idx<Rows>) -> &[Idx<Cols, I>]

Source

pub fn col_idx_of_row( &self, i: Idx<Rows>, ) -> impl '_ + Clone + ExactSizeIterator + DoubleEndedIterator<Item = Idx<Cols>>

Source

pub fn as_shape<V: Shape, H: Shape>( &self, nrows: V, ncols: H, ) -> SymbolicSparseRowMatRef<'_, I, V, H>

Source

pub fn as_dyn(&self) -> SymbolicSparseRowMatRef<'_, I>

Source

pub fn as_ref(&self) -> SymbolicSparseRowMatRef<'_, I, Rows, Cols>

Returns a view over the symbolic structure of self.

Trait Implementations§

Source§

impl<T: ComplexField, I: Index, ViewT: Conjugate<Canonical = T>> BiLinOp<T> for SparseRowMatRef<'_, I, ViewT>

Source§

fn transpose_apply_scratch(&self, rhs_ncols: usize, par: Par) -> StackReq

computes the workspace layout required to apply the transpose or adjoint o self to a matrix with rhs_ncols columns
Source§

fn transpose_apply( &self, out: MatMut<'_, T>, rhs: MatRef<'_, T>, par: Par, stack: &mut MemStack, )

applies the transpose of self to rhs, and stores the result in out
Source§

fn adjoint_apply( &self, out: MatMut<'_, T>, rhs: MatRef<'_, T>, par: Par, stack: &mut MemStack, )

applies the adjoint of self to rhs, and stores the result in out
Source§

impl<T: ComplexField, I: Index, ViewT: Conjugate<Canonical = T>> BiPrecond<T> for SparseRowMatRef<'_, I, ViewT>

Source§

fn transpose_apply_in_place_scratch( &self, rhs_ncols: usize, par: Par, ) -> StackReq

computes the workspace layout required to apply the transpose or adjoint of self to a matrix with rhs_ncols columns in place
Source§

fn transpose_apply_in_place( &self, rhs: MatMut<'_, T>, par: Par, stack: &mut MemStack, )

applies the transpose of self to rhs, and stores the result in rhs
Source§

fn adjoint_apply_in_place( &self, rhs: MatMut<'_, T>, par: Par, stack: &mut MemStack, )

applies the adjoint of self to rhs, and stores the result in rhs
Source§

impl<Rows: Shape, Cols: Shape, I: Index, T: Debug> Debug for SparseRowMatRef<'_, I, T, Rows, Cols>

Source§

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

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

impl<'a, Rows: Shape, Cols: Shape, I: Index, T> Deref for SparseRowMatRef<'a, I, T, Rows, Cols>

Source§

type Target = SymbolicSparseRowMat<Ref<'a, I, Rows, Cols>>

The resulting type after dereferencing.
Source§

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

Dereferences the value.
Source§

impl<I: Index, T> Index<(usize, usize)> for SparseRowMatRef<'_, I, T>

Source§

type Output = T

The returned type after indexing.
Source§

fn index(&self, (row, col): (usize, usize)) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<T: ComplexField, I: Index, ViewT: Conjugate<Canonical = T>> LinOp<T> for SparseRowMatRef<'_, I, ViewT>

Source§

fn nrows(&self) -> usize

output dimension of the operator
Source§

fn ncols(&self) -> usize

input dimension of the operator
Source§

fn apply_scratch(&self, rhs_ncols: usize, par: Par) -> StackReq

computes the workspace layout required to apply self or the conjugate o self to a matrix with rhs_ncols columns
Source§

fn apply( &self, out: MatMut<'_, T>, rhs: MatRef<'_, T>, par: Par, stack: &mut MemStack, )

applies self to rhs, and stores the result in out
Source§

fn conj_apply( &self, out: MatMut<'_, T>, rhs: MatRef<'_, T>, par: Par, stack: &mut MemStack, )

applies the conjugate of self to rhs, and stores the result in out
Source§

impl<T: ComplexField, I: Index, ViewT: Conjugate<Canonical = T>> Precond<T> for SparseRowMatRef<'_, I, ViewT>

Source§

fn apply_in_place_scratch(&self, rhs_ncols: usize, par: Par) -> StackReq

computes the workspace layout required to apply self or the conjugate of self to a matrix with rhs_ncols columns in place
Source§

fn apply_in_place(&self, rhs: MatMut<'_, T>, par: Par, stack: &mut MemStack)

applies self to rhs, and stores the result in rhs
Source§

fn conj_apply_in_place( &self, rhs: MatMut<'_, T>, par: Par, stack: &mut MemStack, )

applies the conjugate of self to rhs, and stores the result in rhs