extendr_api::prelude::modules::core::zip

Trait MatShape

pub trait MatShape {
    type Rows: Copy + Eq + Debug;
    type Cols: Copy + Eq + Debug;

    // Required methods
    fn nrows(&self) -> Self::Rows;
    fn ncols(&self) -> Self::Cols;
}
Expand description

Type with a given matrix shape.

Required Associated Types§

type Rows: Copy + Eq + Debug

Type of rows.

type Cols: Copy + Eq + Debug

Type of columns.

Required Methods§

fn nrows(&self) -> Self::Rows

Returns the number of rows.

fn ncols(&self) -> Self::Cols

Returns the number of columns.

Implementors§

§

impl<E> MatShape for ColMut<'_, E>
where E: Entity,

§

type Rows = usize

§

type Cols = ()

§

impl<E> MatShape for ColRef<'_, E>
where E: Entity,

§

type Rows = usize

§

type Cols = ()

§

impl<E> MatShape for MatMut<'_, E>
where E: Entity,

§

type Rows = usize

§

type Cols = usize

§

impl<E> MatShape for MatRef<'_, E>
where E: Entity,

§

type Rows = usize

§

type Cols = usize

§

impl<E> MatShape for RowMut<'_, E>
where E: Entity,

§

type Rows = ()

§

type Cols = usize

§

impl<E> MatShape for RowRef<'_, E>
where E: Entity,

§

type Rows = ()

§

type Cols = usize

§

impl<Rows, Cols, Head, Tail> MatShape for ZipEq<Rows, Cols, Head, Tail>
where Rows: Copy + Eq + Debug, Cols: Copy + Eq + Debug, Head: MatShape<Rows = Rows, Cols = Cols>, Tail: MatShape<Rows = Rows, Cols = Cols>,

§

type Rows = Rows

§

type Cols = Cols

§

impl<Rows, Cols, Mat> MatShape for LastEq<Rows, Cols, Mat>
where Rows: Copy + Eq + Debug, Cols: Copy + Eq + Debug, Mat: MatShape<Rows = Rows, Cols = Cols>,

§

type Rows = Rows

§

type Cols = Cols