orx_v::matrices

Trait MatrixRowMajor

Source
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§

Source

fn row(&self, i: usize) -> impl NVec<D1, T>

Returns the i-th row of the matrix which is a D1 vector.

Provided Methods§

Source

fn rows(&self) -> impl Iterator<Item = impl NVec<D1, T>>

Returns an iterator over the rows of the matrix.

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.

Implementations on Foreign Types§

Source§

impl<T, M: MatrixRowMajor<T>> MatrixRowMajor<T> for &M

Source§

fn row(&self, j: usize) -> impl NVec<D1, T>

Source§

impl<T, M: MatrixRowMajor<T>> MatrixRowMajor<T> for &mut M

Source§

fn row(&self, j: usize) -> impl NVec<D1, T>

Implementors§

Source§

impl<T, V> MatrixRowMajor<T> for V1Matrix<T, V, V1LayoutRowMajor>
where V: NVec<D1, T>,

Source§

impl<T, V> MatrixRowMajor<T> for V2MatrixRowMajor<T, V>
where V: NVec<D2, T>,