Trait feanor_math::matrix::Matrix
source · pub trait Matrix<R>{
// Required methods
fn row_count(&self) -> usize;
fn col_count(&self) -> usize;
fn entry_at(&self, i: usize, j: usize) -> &R::Element;
// Provided methods
fn format<'a, S>(&'a self, ring: &'a S) -> MatrixDisplayWrapper<'a, R, Self>
where S: RingStore<Type = R> { ... }
fn matrix_eq<M, S>(&self, other: &M, ring: S) -> bool
where M: Matrix<R>,
S: RingStore<Type = R> { ... }
}Expand description
A very minimalistic approach to implement matrices.
I have not yet decided on how exactly this library should “do” matrices. One problem is that efficient algorithms on matrices often need their own layout of data - e.g. sparse vs dense, column-vs row-major storage, maybe support for submatrices is needed, …
Hence, for now, we just have this trait to support writing and equality checking, which should at least vastly simplify testing matrix implementations and algorithms.
Also, note that this is not a library for numeric computations, we will never
get linear algebra operations that efficiently work on floating point numbers.
Use e.g. ndarray for that.
Required Methods§
fn row_count(&self) -> usize
fn col_count(&self) -> usize
fn entry_at(&self, i: usize, j: usize) -> &R::Element
Provided Methods§
fn format<'a, S>(&'a self, ring: &'a S) -> MatrixDisplayWrapper<'a, R, Self>where
S: RingStore<Type = R>,
fn matrix_eq<M, S>(&self, other: &M, ring: S) -> bool
Object Safety§
This trait is not object safe.