pub struct EmptyVec<D: Dim, T> { /* private fields */ }
Expand description
An empty vector of dimension D
with no elements.
Trait Implementations§
Source§impl<D: Dim, T> NVec<D, T> for EmptyVec<D, T>
impl<D: Dim, T> NVec<D, T> for EmptyVec<D, T>
Source§fn at(&self, idx: impl IntoIdx<D>) -> T
fn at(&self, idx: impl IntoIdx<D>) -> T
Returns the element at the
idx
-th position of the vector. Read moreSource§fn child(&self, i: <D as Dim>::ChildIdx) -> impl NVec<<D as Dim>::PrevDim, T>
fn child(&self, i: <D as Dim>::ChildIdx) -> impl NVec<<D as Dim>::PrevDim, T>
Returns the
i
-th child of the vector. Read moreSource§fn all(&self) -> impl Iterator<Item = T>
fn all(&self) -> impl Iterator<Item = T>
Returns a flattened iterator over all scalar (D0) elements of the vector. Read more
Source§fn num_children(&self) -> usize
fn num_children(&self) -> usize
Returns the number of children of the vector; i.e., number of
elements of the one lower dimension. Read more
Source§fn card(&self, idx: impl Into<D::CardIdx>) -> usize
fn card(&self, idx: impl Into<D::CardIdx>) -> usize
Returns the cardinality of the vec in any of the lower dimensions. Read more
Source§fn is_bounded(&self) -> bool
fn is_bounded(&self) -> bool
Returns whether or not the vector is bounded. Read more
Source§fn is_rectangular(&self) -> bool
fn is_rectangular(&self) -> bool
Returns whether or not the cardinalities of the vector are rectangular.
A rectangular vector of dimension
D
has the same number of children
at a given lower dimension for all indices. Read moreSource§fn is_unbounded(&self) -> bool
fn is_unbounded(&self) -> bool
Returns whether or not the vector is unbounded. Read more
Source§fn in_bounds(&self, idx: impl Into<D::LeqIdx>) -> bool
fn in_bounds(&self, idx: impl Into<D::LeqIdx>) -> bool
Returns whether or not the given
idx
is in bounds. Read moreSource§fn card_equality(&self, other: &impl NVec<D, T>) -> CardEquality<D>
fn card_equality(&self, other: &impl NVec<D, T>) -> CardEquality<D>
Returns the cardinality equality of this vec with the
other
: Read moreSource§fn try_at(&self, idx: impl IntoIdx<D>) -> Option<T>
fn try_at(&self, idx: impl IntoIdx<D>) -> Option<T>
Returns the element at the
idx
-th position of the vector if the
index is in_bounds
; returns None otherwise. Read moreSource§fn equality(&self, other: &impl NVec<D, T>) -> Equality<D>where
T: PartialEq,
fn equality(&self, other: &impl NVec<D, T>) -> Equality<D>where
T: PartialEq,
Returns the equality of this vec with the
other
: Read moreSource§impl<D: Dim, T> NVecMut<D, T> for EmptyVec<D, T>
impl<D: Dim, T> NVecMut<D, T> for EmptyVec<D, T>
Source§fn at_mut<Idx: IntoIdx<D>>(&mut self, idx: Idx) -> &mut T
fn at_mut<Idx: IntoIdx<D>>(&mut self, idx: Idx) -> &mut T
Returns a mutable reference to the element at the
idx
-th
position of the vector. Read moreSource§fn child_mut(
&mut self,
i: <D as Dim>::ChildIdx,
) -> impl NVecMut<<D as Dim>::PrevDim, T>
fn child_mut( &mut self, i: <D as Dim>::ChildIdx, ) -> impl NVecMut<<D as Dim>::PrevDim, T>
Returns a mutable reference to the
i
-th child of the vector. Read moreSource§fn mut_all<F>(&mut self, _: F)
fn mut_all<F>(&mut self, _: F)
Applies the mutating function
f
over all scalar elements of the vector. Read moreimpl<D: Copy + Dim, T: Copy> Copy for EmptyVec<D, T>
Auto Trait Implementations§
impl<D, T> Freeze for EmptyVec<D, T>
impl<D, T> RefUnwindSafe for EmptyVec<D, T>where
D: RefUnwindSafe,
T: RefUnwindSafe,
impl<D, T> Send for EmptyVec<D, T>
impl<D, T> Sync for EmptyVec<D, T>
impl<D, T> Unpin for EmptyVec<D, T>
impl<D, T> UnwindSafe for EmptyVec<D, T>where
D: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, V> IntoJagged<T> for V
impl<T, V> IntoJagged<T> for V
Source§fn into_jagged<I>(self, row_end_indices: I) -> FlatJagged<Self, I, T>
fn into_jagged<I>(self, row_end_indices: I) -> FlatJagged<Self, I, T>
Converts a
D1
vector into a jagged D2
vector where each row is
identified by row_end_indices
. Read moreSource§fn as_jagged<I>(&self, row_end_indices: I) -> FlatJagged<&Self, I, T>
fn as_jagged<I>(&self, row_end_indices: I) -> FlatJagged<&Self, I, T>
From a flat
D1
vector, creates a jagged D2
vector view where each row is
identified by row_end_indices
. Read moreSource§fn as_jagged_mut<I>(
&mut self,
row_end_indices: I,
) -> FlatJagged<&mut Self, I, T>
fn as_jagged_mut<I>( &mut self, row_end_indices: I, ) -> FlatJagged<&mut Self, I, T>
From a flat
D1
vector, creates a mutable jagged D2
vector view where each row is
identified by row_end_indices
. Read moreSource§fn into_jagged_from_row_lengths<I>(
self,
row_lengths: &I,
) -> FlatJagged<Self, Vec<usize>, T>
fn into_jagged_from_row_lengths<I>( self, row_lengths: &I, ) -> FlatJagged<Self, Vec<usize>, T>
Source§fn as_jagged_from_row_lengths<I>(
&self,
row_lengths: &I,
) -> FlatJagged<&Self, Vec<usize>, T>
fn as_jagged_from_row_lengths<I>( &self, row_lengths: &I, ) -> FlatJagged<&Self, Vec<usize>, T>
From a flat
D1
vector, creates a jagged D2
vector view where each row is
identified by row_lengths
. Read moreSource§fn as_jagged_mut_from_row_lengths<I>(
&mut self,
row_lengths: &I,
) -> FlatJagged<&mut Self, Vec<usize>, T>
fn as_jagged_mut_from_row_lengths<I>( &mut self, row_lengths: &I, ) -> FlatJagged<&mut Self, Vec<usize>, T>
From a flat
D1
vector, creates a mutable jagged D2
vector view where each row is
identified by row_lengths
. Read moreSource§fn into_jagged_with_uniform_lengths(
self,
uniform_length: usize,
) -> FlatJagged<Self, UniformEndIndices, T>
fn into_jagged_with_uniform_lengths( self, uniform_length: usize, ) -> FlatJagged<Self, UniformEndIndices, T>
Converts a
D1
vector into a jagged D2
vector where each row has the given
uniform_length
, except that the last row might have fewer elements if the
cardinality of the D1
vector is not divisible by the uniform length. Read moreSource§fn as_jagged_with_uniform_lengths(
&self,
uniform_length: usize,
) -> FlatJagged<&Self, UniformEndIndices, T>
fn as_jagged_with_uniform_lengths( &self, uniform_length: usize, ) -> FlatJagged<&Self, UniformEndIndices, T>
From a flat
D1
vector, creates a jagged D2
vector view where each row has
the given uniform_length
, except that the last row might have fewer elements
if the cardinality of the D1
vector is not divisible by the uniform length. Read moreSource§fn as_jagged_mut_with_uniform_lengths(
&mut self,
uniform_length: usize,
) -> FlatJagged<&mut Self, UniformEndIndices, T>
fn as_jagged_mut_with_uniform_lengths( &mut self, uniform_length: usize, ) -> FlatJagged<&mut Self, UniformEndIndices, T>
From a flat
D1
vector, creates a mutable jagged D2
vector view where each row has
the given uniform_length
, except that the last row might have fewer elements
if the cardinality of the D1
vector is not divisible by the uniform length. Read moreSource§impl<T, V> V1AsMatrix<T> for V
impl<T, V> V1AsMatrix<T> for V
Source§fn v1_into_matrix(
self,
num_rows: usize,
num_cols: usize,
) -> V1Matrix<T, Self, V1LayoutRowMajor>
fn v1_into_matrix( self, num_rows: usize, num_cols: usize, ) -> V1Matrix<T, Self, V1LayoutRowMajor>
Converts the flat
D1
vector into a row-major matrix. Read moreSource§fn v1_as_matrix(
&self,
num_rows: usize,
num_cols: usize,
) -> V1Matrix<T, &Self, V1LayoutRowMajor>
fn v1_as_matrix( &self, num_rows: usize, num_cols: usize, ) -> V1Matrix<T, &Self, V1LayoutRowMajor>
Creates a row-major matrix view over the flat
D1
vector. Read moreSource§fn v1_as_matrix_mut(
&mut self,
num_rows: usize,
num_cols: usize,
) -> V1Matrix<T, &mut Self, V1LayoutRowMajor>
fn v1_as_matrix_mut( &mut self, num_rows: usize, num_cols: usize, ) -> V1Matrix<T, &mut Self, V1LayoutRowMajor>
Creates a mutable row-major matrix view over the flat
D1
vector. Read moreSource§fn v1_into_matrix_col_major(
self,
num_rows: usize,
num_cols: usize,
) -> V1Matrix<T, Self, V1LayoutColMajor>
fn v1_into_matrix_col_major( self, num_rows: usize, num_cols: usize, ) -> V1Matrix<T, Self, V1LayoutColMajor>
Converts the flat
D1
vector into a column-major matrix. Read moreSource§fn v1_as_matrix_col_major(
&self,
num_rows: usize,
num_cols: usize,
) -> V1Matrix<T, &Self, V1LayoutColMajor>
fn v1_as_matrix_col_major( &self, num_rows: usize, num_cols: usize, ) -> V1Matrix<T, &Self, V1LayoutColMajor>
Creates a column-major matrix view over the flat
D1
vector. Read moreSource§fn v1_as_matrix_col_major_mut(
&mut self,
num_rows: usize,
num_cols: usize,
) -> V1Matrix<T, &mut Self, V1LayoutColMajor>
fn v1_as_matrix_col_major_mut( &mut self, num_rows: usize, num_cols: usize, ) -> V1Matrix<T, &mut Self, V1LayoutColMajor>
Creates a mutable column-major matrix view over the flat
D1
vector. Read moreSource§impl<T, V> V2AsMatrix<T> for V
impl<T, V> V2AsMatrix<T> for V
Source§fn into_matrix(self) -> V2MatrixRowMajor<T, Self>
fn into_matrix(self) -> V2MatrixRowMajor<T, Self>
Converts the rectangular
D2
vector into a row-major matrix. Read moreSource§fn as_matrix(&self) -> V2MatrixRowMajor<T, &Self>
fn as_matrix(&self) -> V2MatrixRowMajor<T, &Self>
Creates a row-major matrix view over the rectangular
D2
vector. Read moreSource§fn as_matrix_mut(&mut self) -> V2MatrixRowMajor<T, &mut Self>
fn as_matrix_mut(&mut self) -> V2MatrixRowMajor<T, &mut Self>
Creates a mutable row-major matrix view over the rectangular
D2
vector. Read moreSource§fn into_matrix_col_major(self) -> V2MatrixColMajor<T, Self>
fn into_matrix_col_major(self) -> V2MatrixColMajor<T, Self>
Converts the rectangular
D2
vector into a column-major matrix. Read moreSource§fn as_matrix_col_major(&self) -> V2MatrixColMajor<T, &Self>
fn as_matrix_col_major(&self) -> V2MatrixColMajor<T, &Self>
Creates a column-major matrix view over the rectangular
D2
vector. Read moreSource§fn as_matrix_col_major_mut(&mut self) -> V2MatrixColMajor<T, &mut Self>
fn as_matrix_col_major_mut(&mut self) -> V2MatrixColMajor<T, &mut Self>
Creates a mutable column-major matrix view over the rectangular
D2
vector. Read more