Skip to main content

MatrixSparsity

Trait MatrixSparsity 

Source
pub trait MatrixSparsity<M: Matrix>: Sized + Clone {
    // Required methods
    fn nrows(&self) -> IndexType;
    fn ncols(&self) -> IndexType;
    fn is_sparse() -> bool;
    fn try_from_indices(
        nrows: IndexType,
        ncols: IndexType,
        indices: Vec<(IndexType, IndexType)>,
    ) -> Result<Self, LaError>;
    fn indices(&self) -> Vec<(IndexType, IndexType)>;
    fn union(self, other: M::SparsityRef<'_>) -> Result<M::Sparsity, LaError>;
    fn new_diagonal(n: IndexType) -> Self;
    fn as_ref(&self) -> M::SparsityRef<'_>;
    fn get_index(
        &self,
        indices: &[(IndexType, IndexType)],
        ctx: <M::V as VectorCommon>::C,
    ) -> <M::V as Vector>::Index;
}

Required Methods§

Source

fn nrows(&self) -> IndexType

Source

fn ncols(&self) -> IndexType

Source

fn is_sparse() -> bool

Source

fn try_from_indices( nrows: IndexType, ncols: IndexType, indices: Vec<(IndexType, IndexType)>, ) -> Result<Self, LaError>

Source

fn indices(&self) -> Vec<(IndexType, IndexType)>

Source

fn union(self, other: M::SparsityRef<'_>) -> Result<M::Sparsity, LaError>

Source

fn new_diagonal(n: IndexType) -> Self

Source

fn as_ref(&self) -> M::SparsityRef<'_>

Source

fn get_index( &self, indices: &[(IndexType, IndexType)], ctx: <M::V as VectorCommon>::C, ) -> <M::V as Vector>::Index

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: FaerScalar> MatrixSparsity<FaerSparseMat<T>> for SymbolicSparseColMat<IndexType>

Implementors§

Source§

impl<M> MatrixSparsity<M> for Dense<M>
where for<'a> M: Matrix<Sparsity = Dense<M>, SparsityRef<'a> = DenseRef<'a, M>>,