SparseColMat

Type Alias SparseColMat 

Source
pub type SparseColMat<I, T, Rows = usize, Cols = usize> = SparseColMat<Own<I, T, Rows, Cols>>;
Expand description

owning sparse column major matrix

see SymbolicSparseColMatRef

Aliased Type§

#[repr(transparent)]
pub struct SparseColMat<I, T, Rows = usize, Cols = usize>(pub Own<I, T, Rows, Cols>);

Tuple Fields§

§0: Own<I, T, Rows, Cols>

Implementations§

Source§

impl<Rows: Shape, Cols: Shape, I: Index, T> SparseColMat<I, T, Rows, Cols>

Source

pub fn new(symbolic: SymbolicSparseColMat<I, Rows, Cols>, val: Vec<T>) -> Self

Source

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

Source

pub fn parts_mut( &mut self, ) -> (SymbolicSparseColMatRef<'_, I, Rows, Cols>, &mut [T])

Source

pub fn into_parts(self) -> (SymbolicSparseColMat<I, Rows, Cols>, Vec<T>)

Source

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

Source

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

Source

pub fn val_mut(&mut self) -> &mut [T]

Source

pub fn val_of_col(&self, j: Idx<Cols>) -> &[T]

Source

pub fn val_of_col_mut(&mut self, j: Idx<Cols>) -> &mut [T]

Source

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

Source

pub fn as_shape_mut<V: Shape, H: Shape>( &mut self, nrows: V, ncols: H, ) -> SparseColMatMut<'_, I, T, V, H>

Source

pub fn into_shape<V: Shape, H: Shape>( self, nrows: V, ncols: H, ) -> SparseColMat<I, T, V, H>

Source

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

Source

pub fn as_dyn_mut(&mut self) -> SparseColMatMut<'_, I, T>

Source

pub fn into_dyn(self) -> SparseColMat<I, T>

Source

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

Source

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

Source

pub fn transpose_mut(&mut self) -> SparseRowMatMut<'_, I, T, Cols, Rows>

Source

pub fn into_transpose(self) -> SparseRowMat<I, T, Cols, Rows>

Source

pub fn conjugate(&self) -> SparseColMatRef<'_, I, T::Conj, Rows, Cols>
where T: Conjugate,

Source

pub fn conjugate_mut(&mut self) -> SparseColMatMut<'_, I, T::Conj, Rows, Cols>
where T: Conjugate,

Source

pub fn into_conjugate(self) -> SparseColMat<I, T::Conj, Rows, Cols>
where T: Conjugate,

Source

pub fn adjoint(&self) -> SparseRowMatRef<'_, I, T::Conj, Cols, Rows>
where T: Conjugate,

Source

pub fn adjoint_mut(&mut self) -> SparseRowMatMut<'_, I, T::Conj, Cols, Rows>
where T: Conjugate,

Source

pub fn into_adjoint(self) -> SparseRowMat<I, T::Conj, Cols, Rows>
where T: Conjugate,

Source

pub fn canonical(&self) -> SparseColMatRef<'_, I, T::Canonical, Rows, Cols>
where T: Conjugate,

Source

pub fn canonical_mut( &mut self, ) -> SparseColMatMut<'_, I, T::Canonical, Rows, Cols>
where T: Conjugate,

Source

pub fn into_canonical(self) -> SparseColMat<I, T::Canonical, Rows, Cols>
where T: Conjugate,

Source

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

Source

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

Source

pub fn new_from_argsort( symbolic: SymbolicSparseColMat<I, Rows, Cols>, argsort: &Argsort<I>, val: &[T], ) -> Result<Self, FaerError>
where T: ComplexField,

create a new matrix from a previously created symbolic structure and value order

the provided values must correspond to the same indices that were provided in the function call from which the order was created

Source

pub fn try_new_from_triplets( nrows: Rows, ncols: Cols, entries: &[Triplet<Idx<Rows, I>, Idx<Cols, I>, T>], ) -> Result<Self, CreationError>
where T: ComplexField,

create a new matrix from triplets

Source

pub fn try_new_from_nonnegative_triplets( nrows: Rows, ncols: Cols, entries: &[Triplet<MaybeIdx<Rows, I>, MaybeIdx<Cols, I>, T>], ) -> Result<Self, CreationError>
where T: ComplexField,

create a new matrix from triplets

negative indices are ignored

Source

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

Source

pub fn get_mut(&mut self, row: Idx<Rows>, col: Idx<Cols>) -> Option<&mut T>

Source

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

Methods from Deref<Target = SymbolicSparseColMat<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<SymbolicSparseColMat<I, Rows, Cols>, FaerError>

returns a newly allocated matrix holding the values of self

Source

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

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

Source

pub fn compute_nnz(&self) -> usize

returns the number of non-zero elements in the matrix

Source

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

returns the column pointers

Source

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

returns the column non-zero counts

Source

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

returns the row indices

Source

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

returns the range specifying the indices of column j

Source

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

returns the range specifying the indices of column j, without bound checks

Source

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

returns the row indices of column j

Source

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

returns the row indices of column j

Source

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

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 transpose(&self) -> SymbolicSparseRowMatRef<'_, I, Cols, Rows>

returns a view over the transpose of self

Source

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

Source

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

Source

pub fn compute_nnz(&self) -> usize

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Returns a view over the symbolic structure of self.

Trait Implementations§

Source§

impl<I: Index, T: ComplexField, ViewT: Conjugate<Canonical = T>> BiLinOp<T> for SparseColMat<I, ViewT>

Source§

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

computes the workspace size and alignment 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<I: Index, T: ComplexField, ViewT: Conjugate<Canonical = T>> BiPrecond<T> for SparseColMat<I, ViewT>

Source§

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

computes the workspace size and alignment 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 SparseColMat<I, T, Rows, Cols>

Source§

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

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

impl<Rows: Shape, Cols: Shape, I: Index, T> Deref for SparseColMat<I, T, Rows, Cols>

Source§

type Target = SymbolicSparseColMat<Own<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 SparseColMat<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<I: Index, T> IndexMut<(usize, usize)> for SparseColMat<I, T>

Source§

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

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

impl<I: Index, T: ComplexField, ViewT: Conjugate<Canonical = T>> LinOp<T> for SparseColMat<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 size and alignment 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<I: Index, T: ComplexField, ViewT: Conjugate<Canonical = T>> Precond<T> for SparseColMat<I, ViewT>

Source§

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

computes the workspace size and alignment 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