Trait ndarray::Dimension [−][src]
pub trait Dimension: Clone + Eq + Debug + Send + Sync + Default + IndexMut<usize, Output = usize> + Add<Self, Output = Self> + AddAssign + for<'x> AddAssign<&'x Self> + Sub<Self, Output = Self> + SubAssign + for<'x> SubAssign<&'x Self> + Mul<usize, Output = Self> + Mul<Self, Output = Self> + MulAssign + for<'x> MulAssign<&'x Self> + MulAssign<usize> { type SliceArg: ?Sized + AsRef<[Si]>; type Pattern: IntoDimension<Dim = Self>; type Smaller: Dimension; type Larger: Dimension; fn into_pattern(self) -> Self::Pattern; fn __private__(&self) -> PrivateMarker; fn size(&self) -> usize { ... } fn size_checked(&self) -> Option<usize> { ... } fn as_array_view(&self) -> ArrayView1<'_, Ix> { ... } fn as_array_view_mut(&mut self) -> ArrayViewMut1<'_, Ix> { ... } fn into_dyn(self) -> IxDyn { ... } }
Expand description
Array shape and index trait.
This trait defines a number of methods and operations that can be used on dimensions and indices.
Note: This trait can not be implemented outside the crate
Associated Types
SliceArg
is the type which is used to specify slicing for this
dimension.
For the fixed size dimensions it is a fixed size array of the correct size, which you pass by reference. For the dynamic dimension it is a slice.
- For
Ix1
:[Si; 1]
- For
Ix2
:[Si; 2]
- and so on..
- For
IxDyn
:[Si]
The easiest way to create a &SliceArg
is using the macro
s![]
.
type Pattern: IntoDimension<Dim = Self>
[src]
type Pattern: IntoDimension<Dim = Self>
[src]Pattern matching friendly form of the dimension value.
- For
Ix1
:usize
, - For
Ix2
:(usize, usize)
- and so on..
- For
IxDyn
:IxDyn
Required methods
fn into_pattern(self) -> Self::Pattern
[src]
fn into_pattern(self) -> Self::Pattern
[src]Convert the dimension into a pattern matching friendly value.
fn __private__(&self) -> PrivateMarker
[src]
fn __private__(&self) -> PrivateMarker
[src]This trait is private to implement; this method exists to make it impossible to implement outside the crate.
Provided methods
fn size_checked(&self) -> Option<usize>
[src]
fn size_checked(&self) -> Option<usize>
[src]Compute the size while checking for overflow.
fn as_array_view(&self) -> ArrayView1<'_, Ix>
[src]
fn as_array_view(&self) -> ArrayView1<'_, Ix>
[src]Borrow as a read-only array view.
fn as_array_view_mut(&mut self) -> ArrayViewMut1<'_, Ix>
[src]
fn as_array_view_mut(&mut self) -> ArrayViewMut1<'_, Ix>
[src]Borrow as a read-write array view.