Struct ndarray::Dim
[−]
[src]
pub struct Dim<I: ?Sized> { /* fields omitted */ }
Dimension description.
Dim
describes the number of axes and the length of each axis
in an array. It is also used as an index type.
See also the Dimension
trait for its methods and
operations.
Examples
To create an array with a particular dimension, you'd just pass
a tuple (in this example (3, 2) is used), which is converted to
Dim
by the array constructor.
use ndarray::Array2; use ndarray::Dim; let mut array = Array2::zeros((3, 2)); array[[0, 0]] = 1.; assert_eq!(array.raw_dim(), Dim([3, 2]));
Trait Implementations
impl<I> Serialize for Dim<I> where
I: Serialize,
[src]
I: Serialize,
Requires crate feature "serde-1"
fn serialize<Se>(&self, serializer: Se) -> Result<Se::Ok, Se::Error> where
Se: Serializer,
[src]
Se: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'de, I> Deserialize<'de> for Dim<I> where
I: Deserialize<'de>,
[src]
I: Deserialize<'de>,
Requires crate feature "serde-1"
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<I> Encodable for Dim<I> where
I: Encodable,
[src]
I: Encodable,
Requires crate feature "rustc-serialize"
fn encode<E: Encoder>(&self, s: &mut E) -> Result<(), E::Error>
[src]
Serialize a value using an Encoder
.
impl<I> Decodable for Dim<I> where
I: Decodable,
[src]
I: Decodable,
Requires crate feature "rustc-serialize"
fn decode<E: Decoder>(d: &mut E) -> Result<Self, E::Error>
[src]
Deserialize a value using a Decoder
.
impl Index<usize> for Dim<[Ix; 0]>
[src]
type Output = usize
The returned type after indexing.
fn index(&self, index: usize) -> &Self::Output
[src]
Performs the indexing (container[index]
) operation.
impl IndexMut<usize> for Dim<[Ix; 0]>
[src]
fn index_mut(&mut self, index: usize) -> &mut Self::Output
[src]
Performs the mutable indexing (container[index]
) operation.
impl Zero for Dim<[Ix; 0]>
[src]
fn zero() -> Self
[src]
Returns the additive identity element of Self
, 0
. Read more
fn is_zero(&self) -> bool
[src]
Returns true
if self
is equal to the additive identity.
impl Index<usize> for Dim<[Ix; 1]>
[src]
type Output = usize
The returned type after indexing.
fn index(&self, index: usize) -> &Self::Output
[src]
Performs the indexing (container[index]
) operation.
impl IndexMut<usize> for Dim<[Ix; 1]>
[src]
fn index_mut(&mut self, index: usize) -> &mut Self::Output
[src]
Performs the mutable indexing (container[index]
) operation.
impl Zero for Dim<[Ix; 1]>
[src]
fn zero() -> Self
[src]
Returns the additive identity element of Self
, 0
. Read more
fn is_zero(&self) -> bool
[src]
Returns true
if self
is equal to the additive identity.
impl Index<usize> for Dim<[Ix; 2]>
[src]
type Output = usize
The returned type after indexing.
fn index(&self, index: usize) -> &Self::Output
[src]
Performs the indexing (container[index]
) operation.
impl IndexMut<usize> for Dim<[Ix; 2]>
[src]
fn index_mut(&mut self, index: usize) -> &mut Self::Output
[src]
Performs the mutable indexing (container[index]
) operation.
impl Zero for Dim<[Ix; 2]>
[src]
fn zero() -> Self
[src]
Returns the additive identity element of Self
, 0
. Read more
fn is_zero(&self) -> bool
[src]
Returns true
if self
is equal to the additive identity.
impl Index<usize> for Dim<[Ix; 3]>
[src]
type Output = usize
The returned type after indexing.
fn index(&self, index: usize) -> &Self::Output
[src]
Performs the indexing (container[index]
) operation.
impl IndexMut<usize> for Dim<[Ix; 3]>
[src]
fn index_mut(&mut self, index: usize) -> &mut Self::Output
[src]
Performs the mutable indexing (container[index]
) operation.
impl Zero for Dim<[Ix; 3]>
[src]
fn zero() -> Self
[src]
Returns the additive identity element of Self
, 0
. Read more
fn is_zero(&self) -> bool
[src]
Returns true
if self
is equal to the additive identity.
impl Index<usize> for Dim<[Ix; 4]>
[src]
type Output = usize
The returned type after indexing.
fn index(&self, index: usize) -> &Self::Output
[src]
Performs the indexing (container[index]
) operation.
impl IndexMut<usize> for Dim<[Ix; 4]>
[src]
fn index_mut(&mut self, index: usize) -> &mut Self::Output
[src]
Performs the mutable indexing (container[index]
) operation.
impl Zero for Dim<[Ix; 4]>
[src]
fn zero() -> Self
[src]
Returns the additive identity element of Self
, 0
. Read more
fn is_zero(&self) -> bool
[src]
Returns true
if self
is equal to the additive identity.
impl Index<usize> for Dim<[Ix; 5]>
[src]
type Output = usize
The returned type after indexing.
fn index(&self, index: usize) -> &Self::Output
[src]
Performs the indexing (container[index]
) operation.
impl IndexMut<usize> for Dim<[Ix; 5]>
[src]
fn index_mut(&mut self, index: usize) -> &mut Self::Output
[src]
Performs the mutable indexing (container[index]
) operation.
impl Zero for Dim<[Ix; 5]>
[src]
fn zero() -> Self
[src]
Returns the additive identity element of Self
, 0
. Read more
fn is_zero(&self) -> bool
[src]
Returns true
if self
is equal to the additive identity.
impl Index<usize> for Dim<[Ix; 6]>
[src]
type Output = usize
The returned type after indexing.
fn index(&self, index: usize) -> &Self::Output
[src]
Performs the indexing (container[index]
) operation.
impl IndexMut<usize> for Dim<[Ix; 6]>
[src]
fn index_mut(&mut self, index: usize) -> &mut Self::Output
[src]
Performs the mutable indexing (container[index]
) operation.
impl Zero for Dim<[Ix; 6]>
[src]
fn zero() -> Self
[src]
Returns the additive identity element of Self
, 0
. Read more
fn is_zero(&self) -> bool
[src]
Returns true
if self
is equal to the additive identity.
impl<I: Copy + ?Sized> Copy for Dim<I>
[src]
impl<I: Clone + ?Sized> Clone for Dim<I>
[src]
fn clone(&self) -> Dim<I>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<I: PartialEq + ?Sized> PartialEq for Dim<I>
[src]
fn eq(&self, __arg_0: &Dim<I>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Dim<I>) -> bool
[src]
This method tests for !=
.
impl<I: Eq + ?Sized> Eq for Dim<I>
[src]
impl<I: Default + ?Sized> Default for Dim<I>
[src]
impl<I: ?Sized> PartialEq<I> for Dim<I> where
I: PartialEq,
[src]
I: PartialEq,
fn eq(&self, rhs: &I) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<I> Debug for Dim<I> where
I: Debug,
[src]
I: Debug,
impl<I> Add for Dim<I> where
Dim<I>: Dimension,
[src]
Dim<I>: Dimension,
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: Self) -> Self
[src]
Performs the +
operation.
impl<I> AddAssign for Dim<I> where
Dim<I>: Dimension,
[src]
Dim<I>: Dimension,
fn add_assign(&mut self, rhs: Self)
[src]
Performs the +=
operation.
impl<'a, I> AddAssign<&'a Dim<I>> for Dim<I> where
Dim<I>: Dimension,
[src]
Dim<I>: Dimension,
fn add_assign(&mut self, rhs: &Self)
[src]
Performs the +=
operation.
impl Add<Ix> for Dim<[Ix; 1]>
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: Ix) -> Self
[src]
Performs the +
operation.
impl AddAssign<Ix> for Dim<[Ix; 1]>
[src]
fn add_assign(&mut self, rhs: Ix)
[src]
Performs the +=
operation.
impl<I> Sub for Dim<I> where
Dim<I>: Dimension,
[src]
Dim<I>: Dimension,
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: Self) -> Self
[src]
Performs the -
operation.
impl<I> SubAssign for Dim<I> where
Dim<I>: Dimension,
[src]
Dim<I>: Dimension,
fn sub_assign(&mut self, rhs: Self)
[src]
Performs the -=
operation.
impl<'a, I> SubAssign<&'a Dim<I>> for Dim<I> where
Dim<I>: Dimension,
[src]
Dim<I>: Dimension,
fn sub_assign(&mut self, rhs: &Self)
[src]
Performs the -=
operation.
impl Sub<Ix> for Dim<[Ix; 1]>
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: Ix) -> Self
[src]
Performs the -
operation.
impl SubAssign<Ix> for Dim<[Ix; 1]>
[src]
fn sub_assign(&mut self, rhs: Ix)
[src]
Performs the -=
operation.
impl<I> Mul for Dim<I> where
Dim<I>: Dimension,
[src]
Dim<I>: Dimension,
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, rhs: Self) -> Self
[src]
Performs the *
operation.
impl<I> MulAssign for Dim<I> where
Dim<I>: Dimension,
[src]
Dim<I>: Dimension,
fn mul_assign(&mut self, rhs: Self)
[src]
Performs the *=
operation.
impl<'a, I> MulAssign<&'a Dim<I>> for Dim<I> where
Dim<I>: Dimension,
[src]
Dim<I>: Dimension,
fn mul_assign(&mut self, rhs: &Self)
[src]
Performs the *=
operation.
impl<I> Mul<Ix> for Dim<I> where
Dim<I>: Dimension,
[src]
Dim<I>: Dimension,
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, rhs: Ix) -> Self
[src]
Performs the *
operation.
impl<I> MulAssign<Ix> for Dim<I> where
Dim<I>: Dimension,
[src]
Dim<I>: Dimension,
fn mul_assign(&mut self, rhs: Ix)
[src]
Performs the *=
operation.
impl Dimension for Dim<[Ix; 0]>
[src]
type SliceArg = [Si; 0]
SliceArg
is the type which is used to specify slicing for this dimension. Read more
type Pattern = ()
Pattern matching friendly form of the dimension value. Read more
type Smaller = Self
Next smaller dimension (if applicable)
type Larger = Ix1
Next larger dimension
fn ndim(&self) -> usize
[src]
fn slice(&self) -> &[Ix]
[src]
fn slice_mut(&mut self) -> &mut [Ix]
[src]
fn _fastest_varying_stride_order(&self) -> Self
[src]
fn into_pattern(self) -> Self::Pattern
[src]
Convert the dimension into a pattern matching friendly value.
fn next_for(&self, _index: Self) -> Option<Self>
[src]
fn insert_axis(&self, axis: Axis) -> Self::Larger
[src]
fn try_remove_axis(&self, _ignore: Axis) -> Self::Smaller
[src]
fn size(&self) -> usize
[src]
Compute the size of the dimension (number of elements)
fn size_checked(&self) -> Option<usize>
[src]
Compute the size while checking for overflow.
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]
Borrow as a read-write array view.
fn into_dyn(self) -> IxDyn
[src]
Convert the dimensional into a dynamic dimensional (IxDyn).
fn __private__(&self) -> PrivateMarker
[src]
This trait is private to implement; this method exists to make it impossible to implement outside the crate. Read more
impl Dimension for Dim<[Ix; 1]>
[src]
type SliceArg = [Si; 1]
SliceArg
is the type which is used to specify slicing for this dimension. Read more
type Pattern = Ix
Pattern matching friendly form of the dimension value. Read more
type Smaller = Ix0
Next smaller dimension (if applicable)
type Larger = Ix2
Next larger dimension
fn ndim(&self) -> usize
[src]
fn slice(&self) -> &[Ix]
[src]
fn slice_mut(&mut self) -> &mut [Ix]
[src]
fn into_pattern(self) -> Self::Pattern
[src]
Convert the dimension into a pattern matching friendly value.
fn next_for(&self, index: Self) -> Option<Self>
[src]
fn equal(&self, rhs: &Self) -> bool
[src]
fn size(&self) -> usize
[src]
Compute the size of the dimension (number of elements)
fn size_checked(&self) -> Option<usize>
[src]
Compute the size while checking for overflow.
fn default_strides(&self) -> Self
[src]
fn _fastest_varying_stride_order(&self) -> Self
[src]
fn min_stride_axis(&self, _: &Self) -> Axis
[src]
fn max_stride_axis(&self, _: &Self) -> Axis
[src]
fn first_index(&self) -> Option<Self>
[src]
fn stride_offset(index: &Self, stride: &Self) -> isize
[src]
fn stride_offset_checked(&self, stride: &Self, index: &Self) -> Option<isize>
[src]
fn insert_axis(&self, axis: Axis) -> Self::Larger
[src]
fn try_remove_axis(&self, axis: Axis) -> Self::Smaller
[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]
Borrow as a read-write array view.
fn into_dyn(self) -> IxDyn
[src]
Convert the dimensional into a dynamic dimensional (IxDyn).
fn __private__(&self) -> PrivateMarker
[src]
This trait is private to implement; this method exists to make it impossible to implement outside the crate. Read more
impl Dimension for Dim<[Ix; 2]>
[src]
type SliceArg = [Si; 2]
SliceArg
is the type which is used to specify slicing for this dimension. Read more
type Pattern = (Ix, Ix)
Pattern matching friendly form of the dimension value. Read more
type Smaller = Ix1
Next smaller dimension (if applicable)
type Larger = Ix3
Next larger dimension
fn ndim(&self) -> usize
[src]
fn into_pattern(self) -> Self::Pattern
[src]
Convert the dimension into a pattern matching friendly value.
fn slice(&self) -> &[Ix]
[src]
fn slice_mut(&mut self) -> &mut [Ix]
[src]
fn next_for(&self, index: Self) -> Option<Self>
[src]
fn equal(&self, rhs: &Self) -> bool
[src]
fn size(&self) -> usize
[src]
Compute the size of the dimension (number of elements)
fn size_checked(&self) -> Option<usize>
[src]
Compute the size while checking for overflow.
fn last_elem(&self) -> usize
[src]
fn set_last_elem(&mut self, i: usize)
[src]
fn default_strides(&self) -> Self
[src]
fn fortran_strides(&self) -> Self
[src]
fn _fastest_varying_stride_order(&self) -> Self
[src]
fn min_stride_axis(&self, strides: &Self) -> Axis
[src]
fn first_index(&self) -> Option<Self>
[src]
fn stride_offset(index: &Self, strides: &Self) -> isize
[src]
fn stride_offset_checked(&self, strides: &Self, index: &Self) -> Option<isize>
[src]
fn insert_axis(&self, axis: Axis) -> Self::Larger
[src]
fn try_remove_axis(&self, axis: Axis) -> Self::Smaller
[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]
Borrow as a read-write array view.
fn into_dyn(self) -> IxDyn
[src]
Convert the dimensional into a dynamic dimensional (IxDyn).
fn __private__(&self) -> PrivateMarker
[src]
This trait is private to implement; this method exists to make it impossible to implement outside the crate. Read more
impl Dimension for Dim<[Ix; 3]>
[src]
type SliceArg = [Si; 3]
SliceArg
is the type which is used to specify slicing for this dimension. Read more
type Pattern = (Ix, Ix, Ix)
Pattern matching friendly form of the dimension value. Read more
type Smaller = Ix2
Next smaller dimension (if applicable)
type Larger = Ix4
Next larger dimension
fn ndim(&self) -> usize
[src]
fn into_pattern(self) -> Self::Pattern
[src]
Convert the dimension into a pattern matching friendly value.
fn slice(&self) -> &[Ix]
[src]
fn slice_mut(&mut self) -> &mut [Ix]
[src]
fn size(&self) -> usize
[src]
Compute the size of the dimension (number of elements)
fn next_for(&self, index: Self) -> Option<Self>
[src]
fn stride_offset(index: &Self, strides: &Self) -> isize
[src]
fn stride_offset_checked(&self, strides: &Self, index: &Self) -> Option<isize>
[src]
fn _fastest_varying_stride_order(&self) -> Self
[src]
fn insert_axis(&self, axis: Axis) -> Self::Larger
[src]
fn try_remove_axis(&self, axis: Axis) -> Self::Smaller
[src]
fn size_checked(&self) -> Option<usize>
[src]
Compute the size while checking for overflow.
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]
Borrow as a read-write array view.
fn into_dyn(self) -> IxDyn
[src]
Convert the dimensional into a dynamic dimensional (IxDyn).
fn __private__(&self) -> PrivateMarker
[src]
This trait is private to implement; this method exists to make it impossible to implement outside the crate. Read more
impl Dimension for Dim<[Ix; 4]>
[src]
type SliceArg = [Si; 4]
SliceArg
is the type which is used to specify slicing for this dimension. Read more
type Pattern = (Ix, Ix, Ix, Ix)
Pattern matching friendly form of the dimension value. Read more
type Smaller = Dim<[Ix; 3]>
Next smaller dimension (if applicable)
type Larger = Ix5
Next larger dimension
fn ndim(&self) -> usize
[src]
fn into_pattern(self) -> Self::Pattern
[src]
Convert the dimension into a pattern matching friendly value.
fn slice(&self) -> &[Ix]
[src]
fn slice_mut(&mut self) -> &mut [Ix]
[src]
fn insert_axis(&self, axis: Axis) -> Self::Larger
[src]
fn try_remove_axis(&self, axis: Axis) -> Self::Smaller
[src]
fn size(&self) -> usize
[src]
Compute the size of the dimension (number of elements)
fn size_checked(&self) -> Option<usize>
[src]
Compute the size while checking for overflow.
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]
Borrow as a read-write array view.
fn into_dyn(self) -> IxDyn
[src]
Convert the dimensional into a dynamic dimensional (IxDyn).
fn __private__(&self) -> PrivateMarker
[src]
This trait is private to implement; this method exists to make it impossible to implement outside the crate. Read more
impl Dimension for Dim<[Ix; 5]>
[src]
type SliceArg = [Si; 5]
SliceArg
is the type which is used to specify slicing for this dimension. Read more
type Pattern = (Ix, Ix, Ix, Ix, Ix)
Pattern matching friendly form of the dimension value. Read more
type Smaller = Dim<[Ix; 4]>
Next smaller dimension (if applicable)
type Larger = Ix6
Next larger dimension
fn ndim(&self) -> usize
[src]
fn into_pattern(self) -> Self::Pattern
[src]
Convert the dimension into a pattern matching friendly value.
fn slice(&self) -> &[Ix]
[src]
fn slice_mut(&mut self) -> &mut [Ix]
[src]
fn insert_axis(&self, axis: Axis) -> Self::Larger
[src]
fn try_remove_axis(&self, axis: Axis) -> Self::Smaller
[src]
fn size(&self) -> usize
[src]
Compute the size of the dimension (number of elements)
fn size_checked(&self) -> Option<usize>
[src]
Compute the size while checking for overflow.
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]
Borrow as a read-write array view.
fn into_dyn(self) -> IxDyn
[src]
Convert the dimensional into a dynamic dimensional (IxDyn).
fn __private__(&self) -> PrivateMarker
[src]
This trait is private to implement; this method exists to make it impossible to implement outside the crate. Read more
impl Dimension for Dim<[Ix; 6]>
[src]
type SliceArg = [Si; 6]
SliceArg
is the type which is used to specify slicing for this dimension. Read more
type Pattern = (Ix, Ix, Ix, Ix, Ix, Ix)
Pattern matching friendly form of the dimension value. Read more
type Smaller = Dim<[Ix; 5]>
Next smaller dimension (if applicable)
type Larger = IxDyn
Next larger dimension
fn ndim(&self) -> usize
[src]
fn into_pattern(self) -> Self::Pattern
[src]
Convert the dimension into a pattern matching friendly value.
fn slice(&self) -> &[Ix]
[src]
fn slice_mut(&mut self) -> &mut [Ix]
[src]
fn insert_axis(&self, axis: Axis) -> Self::Larger
[src]
fn try_remove_axis(&self, axis: Axis) -> Self::Smaller
[src]
fn size(&self) -> usize
[src]
Compute the size of the dimension (number of elements)
fn size_checked(&self) -> Option<usize>
[src]
Compute the size while checking for overflow.
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]
Borrow as a read-write array view.
fn into_dyn(self) -> IxDyn
[src]
Convert the dimensional into a dynamic dimensional (IxDyn).
fn __private__(&self) -> PrivateMarker
[src]
This trait is private to implement; this method exists to make it impossible to implement outside the crate. Read more
impl Index<usize> for Dim<IxDynImpl>
[src]
type Output = <IxDynImpl as Index<usize>>::Output
The returned type after indexing.
fn index(&self, index: usize) -> &Self::Output
[src]
Performs the indexing (container[index]
) operation.
impl IndexMut<usize> for Dim<IxDynImpl>
[src]
fn index_mut(&mut self, index: usize) -> &mut Self::Output
[src]
Performs the mutable indexing (container[index]
) operation.