ZipEq

Struct ZipEq 

Source
pub struct ZipEq<Rows, Cols, Head, Tail>(pub Head, pub Tail, _);
Expand description

zipped matrices

Tuple Fields§

§0: Head§1: Tail

Implementations§

Source§

impl<Rows: Copy + Eq + Debug, Cols: Copy + Eq + Debug, Head: MatIndex<Rows = Rows, Cols = Cols>, Tail: MatIndex<Rows = Rows, Cols = Cols>> ZipEq<Rows, Cols, Head, Tail>

single matrix view

Source

pub fn new(head: Head, tail: Tail) -> Self

creates a zip matrix, after asserting that the dimensions match

Source

pub fn new_unchecked(head: Head, tail: Tail) -> Self

creates a zip matrix, assuming that the dimensions match

Source§

impl<Rows: Shape, Cols: Shape, L: MatIndex<LayoutTransform = MatLayoutTransform, Rows = Rows, Cols = Cols, Index = (Idx<Rows>, Idx<Cols>)>, R: MatIndex<LayoutTransform = MatLayoutTransform, Rows = Rows, Cols = Cols, Index = (Idx<Rows>, Idx<Cols>)>> ZipEq<Rows, Cols, L, R>
where L::Dyn: MatIndex<Rows = usize, Cols = usize, Index = (usize, usize)>, R::Dyn: MatIndex<Rows = usize, Cols = usize, Index = (usize, usize)>,

Source

pub fn for_each(self, f: impl FnMut(<Self as MatIndex>::Item))

applies f to each element of self

Source

pub fn for_each_with_index( self, f: impl FnMut(Idx<Rows>, Idx<Cols>, <Self as MatIndex>::Item), )

applies f to each element of self, while passing the indices of the position of the current element

Source

pub fn for_each_triangular_lower_with_index( self, diag: Diag, f: impl FnMut(Idx<Rows>, Idx<Cols>, <Self as MatIndex>::Item), )

applies f to each element of the lower triangular half of self, while passing the indices of the position of the current element

diag specifies whether the diagonal should be included or excluded

Source

pub fn for_each_triangular_upper_with_index( self, diag: Diag, f: impl FnMut(Idx<Rows>, Idx<Cols>, <Self as MatIndex>::Item), )

applies f to each element of the upper triangular half of self, while passing the indices of the position of the current element

diag specifies whether the diagonal should be included or excluded

Source

pub fn for_each_triangular_lower( self, diag: Diag, f: impl FnMut(<Self as MatIndex>::Item), )

applies f to each element of the lower triangular half of self

diag specifies whether the diagonal should be included or excluded

Source

pub fn for_each_triangular_upper( self, diag: Diag, f: impl FnMut(<Self as MatIndex>::Item), )

applies f to each element of the upper triangular half of self

diag specifies whether the diagonal should be included or excluded

Source

pub fn map<T>( self, f: impl FnMut(<Self as MatIndex>::Item) -> T, ) -> Mat<T, Rows, Cols>

applies f to each element of self and collect its result into a new matrix

Source

pub fn map_with_index<T>( self, f: impl FnMut(Idx<Rows>, Idx<Cols>, <Self as MatIndex>::Item) -> T, ) -> Mat<T, Rows, Cols>

applies f to each element of self and collect its result into a new matrix

Source§

impl<Rows: Shape, L: MatIndex<LayoutTransform = VecLayoutTransform, Rows = Rows, Cols = (), Index = Idx<Rows>>, R: MatIndex<LayoutTransform = VecLayoutTransform, Rows = Rows, Cols = (), Index = Idx<Rows>>> ZipEq<Rows, (), L, R>
where L::Dyn: MatIndex<Rows = usize, Cols = (), Index = usize>, R::Dyn: MatIndex<Rows = usize, Cols = (), Index = usize>,

Source

pub fn for_each(self, f: impl FnMut(<Self as MatIndex>::Item))

applies f to each element of self

Source

pub fn for_each_with_index( self, f: impl FnMut(Idx<Rows>, <Self as MatIndex>::Item), )

applies f to each element of self, while passing the indices of the position of the current element

Source

pub fn map<T>( self, f: impl FnMut(<Self as MatIndex>::Item) -> T, ) -> Col<T, Rows>

applies f to each element of self and collect its result into a new matrix

Source

pub fn map_with_index<T>( self, f: impl FnMut(Idx<Rows>, <Self as MatIndex>::Item) -> T, ) -> Col<T, Rows>

applies f to each element of self and collect its result into a new matrix

Source§

impl<Cols: Shape, L: MatIndex<LayoutTransform = VecLayoutTransform, Rows = (), Cols = Cols, Index = Idx<Cols>>, R: MatIndex<LayoutTransform = VecLayoutTransform, Rows = (), Cols = Cols, Index = Idx<Cols>>> ZipEq<(), Cols, L, R>
where L::Dyn: MatIndex<Rows = (), Cols = usize, Index = usize>, R::Dyn: MatIndex<Rows = (), Cols = usize, Index = usize>,

Source

pub fn for_each(self, f: impl FnMut(<Self as MatIndex>::Item))

applies f to each element of self

Source

pub fn for_each_with_index( self, f: impl FnMut(Idx<Cols>, <Self as MatIndex>::Item), )

applies f to each element of self, while passing the indices of the position of the current element

Source

pub fn map<T>( self, f: impl FnMut(<Self as MatIndex>::Item) -> T, ) -> Row<T, Cols>

applies f to each element of self and collect its result into a new matrix

Source

pub fn map_with_index<T>( self, f: impl FnMut(Idx<Cols>, <Self as MatIndex>::Item) -> T, ) -> Row<T, Cols>

applies f to each element of self and collect its result into a new matrix

Trait Implementations§

Source§

impl<Rows: Clone, Cols: Clone, Head: Clone, Tail: Clone> Clone for ZipEq<Rows, Cols, Head, Tail>

Source§

fn clone(&self) -> ZipEq<Rows, Cols, Head, Tail>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Rows: Debug, Cols: Debug, Head: Debug, Tail: Debug> Debug for ZipEq<Rows, Cols, Head, Tail>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Rows: Copy + Eq + Debug, Cols: Copy + Eq + Debug, L: MatIndex<Rows = Rows, Cols = Cols>, R: MatIndex<Rows = Rows, Cols = Cols, Index = L::Index, LayoutTransform = L::LayoutTransform>> MatIndex for ZipEq<Rows, Cols, L, R>
where R::Dyn: MatIndex<Rows = <L::Dyn as MatIndex>::Rows, Cols = <L::Dyn as MatIndex>::Cols, Index = <L::Dyn as MatIndex>::Index>,

Source§

type Cols = <L as MatIndex>::Cols

type of columns
Source§

type Dyn = ZipEq<<<L as MatIndex>::Dyn as MatIndex>::Rows, <<L as MatIndex>::Dyn as MatIndex>::Cols, <L as MatIndex>::Dyn, <R as MatIndex>::Dyn>

matrix type with type erased dimensions
Source§

type Index = <L as MatIndex>::Index

indexing type
Source§

type Item = Zip<<L as MatIndex>::Item, <R as MatIndex>::Item>

item produced by the zip views
Source§

type LayoutTransform = <L as MatIndex>::LayoutTransform

layout transformation type
Source§

type Rows = <L as MatIndex>::Rows

type of rows
Source§

type Slice = Zip<<L as MatIndex>::Slice, <R as MatIndex>::Slice>

Source§

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

returns the number of rows
Source§

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

returns the number of columns
Source§

unsafe fn get_slice_unchecked<'a>( this: &'a mut Self, idx: Self::Index, n_elems: usize, ) -> <Self::Slice as SliceFamily<'a, Self::Item>>::Slice

returns slice at index of length n_elems
Source§

unsafe fn from_dyn_idx(idx: <Self::Dyn as MatIndex>::Index) -> Self::Index

converts a type erased index back to its original representation
Source§

unsafe fn get_unchecked(this: &mut Self, index: Self::Index) -> Self::Item

get the item at the given index, skipping bound checks
Source§

unsafe fn next_unchecked<'a>( slice: &mut <Self::Slice as SliceFamily<'a, Self::Item>>::Slice, ) -> Self::Item

get the item at the given slice position, skipping bound checks
Source§

fn is_contiguous(this: &Self) -> bool

checks if the zip matrices are contiguous
Source§

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

computes the preferred iteration layout of the matrices
Source§

fn with_layout(this: Self, layout: Self::LayoutTransform) -> Self::Dyn

applies the layout transformation to the matrices
Source§

impl<Rows: Copy, Cols: Copy, Head: Copy, Tail: Copy> Copy for ZipEq<Rows, Cols, Head, Tail>

Auto Trait Implementations§

§

impl<Rows, Cols, Head, Tail> Freeze for ZipEq<Rows, Cols, Head, Tail>
where Head: Freeze, Tail: Freeze,

§

impl<Rows, Cols, Head, Tail> RefUnwindSafe for ZipEq<Rows, Cols, Head, Tail>
where Head: RefUnwindSafe, Tail: RefUnwindSafe, Rows: RefUnwindSafe, Cols: RefUnwindSafe,

§

impl<Rows, Cols, Head, Tail> Send for ZipEq<Rows, Cols, Head, Tail>
where Head: Send, Tail: Send, Rows: Send, Cols: Send,

§

impl<Rows, Cols, Head, Tail> Sync for ZipEq<Rows, Cols, Head, Tail>
where Head: Sync, Tail: Sync, Rows: Sync, Cols: Sync,

§

impl<Rows, Cols, Head, Tail> Unpin for ZipEq<Rows, Cols, Head, Tail>
where Head: Unpin, Tail: Unpin, Rows: Unpin, Cols: Unpin,

§

impl<Rows, Cols, Head, Tail> UnwindSafe for ZipEq<Rows, Cols, Head, Tail>
where Head: UnwindSafe, Tail: UnwindSafe, Rows: UnwindSafe, Cols: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ByRef<T> for T

Source§

fn by_ref(&self) -> &T

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DistributionExt for T
where T: ?Sized,

Source§

fn rand<T>(&self, rng: &mut (impl ?Sized + Rng)) -> T
where Self: Distribution<T>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V