MatrixOrder

Trait MatrixOrder 

Source
pub trait MatrixOrder: Sized {
    // Required methods
    fn new<F, C>(
        data: Vec<SparseTupleVec<F>>,
        nr_rows: usize,
        nr_columns: usize,
    ) -> SparseMatrix<F, C, Self>
       where F: SparseElement<C>,
             C: SparseComparator;
    fn from_test_data<F, C, IT: NonZero + Clone>(
        rows: &[Vec<IT>],
        nr_columns: usize,
    ) -> SparseMatrix<F, C, Self>
       where F: SparseElement<C> + From<IT>,
             C: SparseComparator;

    // Provided method
    fn identity<F, C>(n: usize) -> SparseMatrix<F, C, Self>
       where F: Field + Borrow<C> + SparseElement<C>,
             C: SparseComparator { ... }
}
Expand description

The backend of a SparseMatrix can either be column or row major.

Required Methods§

Source

fn new<F, C>( data: Vec<SparseTupleVec<F>>, nr_rows: usize, nr_columns: usize, ) -> SparseMatrix<F, C, Self>

Create a new matrix with this ordering, using specified data.

Note that the dimensions specified should match the “dimensions” of the data given, and that there can be no duplicate indices in the same collection of values in the given data.

Source

fn from_test_data<F, C, IT: NonZero + Clone>( rows: &[Vec<IT>], nr_columns: usize, ) -> SparseMatrix<F, C, Self>
where F: SparseElement<C> + From<IT>, C: SparseComparator,

Utility method that creates a sparse matrix of this ordering for tests.

Note that the numerics might not be exact due to intermediate casting to floats, for convenience in other places of the code base.

Provided Methods§

Source

fn identity<F, C>(n: usize) -> SparseMatrix<F, C, Self>
where F: Field + Borrow<C> + SparseElement<C>, C: SparseComparator,

Identity matrix of specified field type with this ordering.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§