Trait extendr_api::prelude::modules::core::zip::MatIndex

pub unsafe trait MatIndex<'a, _Outlives = &'a Self>: MaybeContiguous {
    type Item;

    // Required methods
    unsafe fn get_unchecked(&'a mut self, index: Self::Index) -> Self::Item;
    unsafe fn get_from_slice_unchecked(
        slice: &'a mut Self::Slice,
        idx: usize,
    ) -> Self::Item;
    fn is_contiguous(&self) -> bool;
    fn preferred_layout(&self) -> Self::LayoutTransform;
    fn with_layout(self, layout: Self::LayoutTransform) -> Self;
}
Expand description

Zipped matrix views.

Required Associated Types§

type Item

Item produced by the zipped views.

Required Methods§

unsafe fn get_unchecked(&'a mut self, index: Self::Index) -> Self::Item

Get the item at the given index, skipping bound checks.

unsafe fn get_from_slice_unchecked( slice: &'a mut Self::Slice, idx: usize, ) -> Self::Item

Get the item at the given slice position, skipping bound checks.

fn is_contiguous(&self) -> bool

Checks if the zipped matrices are contiguous.

fn preferred_layout(&self) -> Self::LayoutTransform

Computes the preferred iteration layout of the matrices.

fn with_layout(self, layout: Self::LayoutTransform) -> Self

Applies the layout transformation to the matrices.

Object Safety§

This trait is not object safe.

Implementors§

§

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

§

type Item = ReadWrite<'a, E>

§

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

§

type Item = Read<'a, E>

§

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

§

type Item = ReadWrite<'a, E>

§

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

§

type Item = Read<'a, E>

§

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

§

type Item = ReadWrite<'a, E>

§

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

§

type Item = Read<'a, E>

§

impl<'a, Rows, Cols, Head, Tail> MatIndex<'a> for ZipEq<Rows, Cols, Head, Tail>
where Rows: Debug + Copy + Eq, Cols: Copy + Eq + Debug, Head: MatIndex<'a, Rows = Rows, Cols = Cols>, Tail: MatIndex<'a, Rows = Rows, Cols = Cols, Index = <Head as MaybeContiguous>::Index, LayoutTransform = <Head as MaybeContiguous>::LayoutTransform>,

§

type Item = Zip<<Head as MatIndex<'a>>::Item, <Tail as MatIndex<'a>>::Item>

§

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

§

type Item = Last<<Mat as MatIndex<'a>>::Item>