Trait Matrix

Source
pub trait Matrix:
    Sized
    + Clone
    + Mul<Self::Row, Output = Self::Column> {
    type Field: Field;
    type Row: FiniteDimVectorSpace<Field = Self::Field>;
    type Column: FiniteDimVectorSpace<Field = Self::Field>;
    type Transpose: Matrix<Field = Self::Field, Row = Self::Column, Column = Self::Row>;

    // Required methods
    fn nrows(&self) -> usize;
    fn ncolumns(&self) -> usize;
    fn row(&self, i: usize) -> Self::Row;
    fn column(&self, i: usize) -> Self::Column;
    unsafe fn get_unchecked(&self, i: usize, j: usize) -> Self::Field;
    fn transpose(&self) -> Self::Transpose;

    // Provided method
    fn get(&self, i: usize, j: usize) -> Self::Field { ... }
}
Expand description

The space of all matrices.

Required Associated Types§

Source

type Field: Field

The underlying field.

Source

type Row: FiniteDimVectorSpace<Field = Self::Field>

The type of rows of this matrix.

Source

type Column: FiniteDimVectorSpace<Field = Self::Field>

The type of columns of this matrix.

Source

type Transpose: Matrix<Field = Self::Field, Row = Self::Column, Column = Self::Row>

The type of the transposed matrix.

Required Methods§

Source

fn nrows(&self) -> usize

The number of rows of this matrix.

Source

fn ncolumns(&self) -> usize

The number of columns of this matrix.

Source

fn row(&self, i: usize) -> Self::Row

The i-th row of this matrix.

Source

fn column(&self, i: usize) -> Self::Column

The i-th column of this matrix.

Source

unsafe fn get_unchecked(&self, i: usize, j: usize) -> Self::Field

Gets the component at row i and column j of this matrix without bound checking.

Source

fn transpose(&self) -> Self::Transpose

Transposes this matrix.

Provided Methods§

Source

fn get(&self, i: usize, j: usize) -> Self::Field

Gets the component at row i and column j of this 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.

Implementors§