pub trait MatrixColMajor<T>: Matrix<T> {
// Required method
fn col(&self, j: usize) -> impl NVec<D1, T>;
// Provided method
fn cols(&self) -> impl Iterator<Item = impl NVec<D1, T>> { ... }
}
Expand description
A column major matrix.
Say i represents row-index and j represents col-index. In a column-major matrix:
- it is more efficient to iterate first over j, and then over i,
- [
col(j)
] 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.