Skip to main content

SparseFromDense

Trait SparseFromDense 

Source
pub trait SparseFromDense<T> {
    // Required method
    fn from_dense_matrix(
        mat: MatRef<'_, T>,
        format: CompressedSparseFormat,
    ) -> Self;
}
Expand description

Builds a CompressedSparseData2 from a dense faer matrix.

An extension trait rather than an inherent method, as the sparse structure lives in bixverse-sparse, which does not depend on faer.

Required Methods§

Source

fn from_dense_matrix(mat: MatRef<'_, T>, format: CompressedSparseFormat) -> Self

Generates a sparse matrix from a dense matrix

§Params
  • mat: The dense matrix to convert to a sparse matrix
  • format: The format of the sparse matrix to generate
§Returns
  • Self: The sparse matrix generated from the dense matrix

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§