Skip to main content

MatrixCommon

Trait MatrixCommon 

Source
pub trait MatrixCommon: Sized + Debug {
    type V: Vector<T = Self::T, C = Self::C, Index: VectorIndex<C = Self::C>>;
    type T: Scalar;
    type C: Context;
    type Inner;

    // Required methods
    fn nrows(&self) -> IndexType;
    fn ncols(&self) -> IndexType;
    fn inner(&self) -> &Self::Inner;
}
Expand description

Common interface for matrix types, providing access to scalar type, context, and dimensions.

Required Associated Types§

Source

type V: Vector<T = Self::T, C = Self::C, Index: VectorIndex<C = Self::C>>

Source

type T: Scalar

Source

type C: Context

Source

type Inner

Required Methods§

Source

fn nrows(&self) -> IndexType

Get the number of rows in this matrix.

Source

fn ncols(&self) -> IndexType

Get the number of columns in this matrix.

Source

fn inner(&self) -> &Self::Inner

Get a reference to the inner representation of the matrix.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<M> MatrixCommon for &M
where M: MatrixCommon,

Source§

type T = <M as MatrixCommon>::T

Source§

type V = <M as MatrixCommon>::V

Source§

type C = <M as MatrixCommon>::C

Source§

type Inner = <M as MatrixCommon>::Inner

Source§

fn nrows(&self) -> IndexType

Source§

fn ncols(&self) -> IndexType

Source§

fn inner(&self) -> &Self::Inner

Source§

impl<M> MatrixCommon for &mut M
where M: MatrixCommon,

Source§

type T = <M as MatrixCommon>::T

Source§

type V = <M as MatrixCommon>::V

Source§

type C = <M as MatrixCommon>::C

Source§

type Inner = <M as MatrixCommon>::Inner

Source§

fn ncols(&self) -> IndexType

Source§

fn nrows(&self) -> IndexType

Source§

fn inner(&self) -> &Self::Inner

Implementors§