Trait Matrix

Source
pub trait Matrix<V: Vector> {
    // Required methods
    fn add(&self, other: &Self) -> Self;
    fn subtract(&self, other: &Self) -> Self;
    fn multiply(&self, other: &Self) -> Self;
    fn transpose(&self) -> Self;
    fn inverse(&self) -> Self;
    fn transform(&self, other: &V) -> V;
    fn determinant(&self) -> f32;
    fn size(&self) -> (usize, usize);
    fn row(&self, row: usize) -> &V;
    fn at(&self, row: usize, column: usize) -> V::Scalar;
    fn update(&mut self, row: usize, column: usize, value: V::Scalar);
}
Expand description

Matrix trait which defines the basic operations that can be performed on a matrix. Lambda currently implements this trait for f32 arrays of arrays for any size.

Required Methods§

Source

fn add(&self, other: &Self) -> Self

Source

fn subtract(&self, other: &Self) -> Self

Source

fn multiply(&self, other: &Self) -> Self

Source

fn transpose(&self) -> Self

Source

fn inverse(&self) -> Self

Source

fn transform(&self, other: &V) -> V

Source

fn determinant(&self) -> f32

Source

fn size(&self) -> (usize, usize)

Source

fn row(&self, row: usize) -> &V

Source

fn at(&self, row: usize, column: usize) -> V::Scalar

Source

fn update(&mut self, row: usize, column: usize, value: V::Scalar)

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§

Source§

impl<Array, V> Matrix<V> for Array
where Array: AsMut<[V]> + AsRef<[V]> + Default, V: AsMut<[f32]> + AsRef<[f32]> + Vector<Scalar = f32> + Sized,

Matrix implementations for arrays of f32 arrays. Including the trait Matrix into your code will allow you to use these function implementation for any array of f32 arrays.