pub trait MatrixRowMajor<T>: Matrix<T> {
// Required method
fn row(&self, i: usize) -> impl NVec<D1, T>;
// Provided method
fn rows(&self) -> impl Iterator<Item = impl NVec<D1, T>> { ... }
}
Expand description
A row major matrix.
Say i represents row-index and j represents col-index. In a row-major matrix:
- it is more efficient to iterate first over i, and then over j,
- [
row(i)
] often (1) returns a vector over a contagious memory location.
(1) When the data is represented by a complete allocation; however, recall that it is possible to use a function or a sparse vector backed up with a lookup as the underlying vector of the matrix.
Required Methods§
Provided Methods§
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.