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_dimension(), Dim([3, 2]));
Trait Implementations
impl Index<usize> for Dim<[Ix; 0]>
[src]
type Output = usize
The returned type after indexing
fn index(&self, index: usize) -> &Self::Output
The method for the indexing (container[index]
) operation
impl IndexMut<usize> for Dim<[Ix; 0]>
[src]
fn index_mut(&mut self, index: usize) -> &mut Self::Output
The method for the mutable indexing (container[index]
) operation
impl Zero for Dim<[Ix; 0]>
[src]
fn zero() -> Self
Returns the additive identity element of Self
, 0
. Read more
fn is_zero(&self) -> bool
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
The method for the indexing (container[index]
) operation
impl IndexMut<usize> for Dim<[Ix; 1]>
[src]
fn index_mut(&mut self, index: usize) -> &mut Self::Output
The method for the mutable indexing (container[index]
) operation
impl Zero for Dim<[Ix; 1]>
[src]
fn zero() -> Self
Returns the additive identity element of Self
, 0
. Read more
fn is_zero(&self) -> bool
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
The method for the indexing (container[index]
) operation
impl IndexMut<usize> for Dim<[Ix; 2]>
[src]
fn index_mut(&mut self, index: usize) -> &mut Self::Output
The method for the mutable indexing (container[index]
) operation
impl Zero for Dim<[Ix; 2]>
[src]
fn zero() -> Self
Returns the additive identity element of Self
, 0
. Read more
fn is_zero(&self) -> bool
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
The method for the indexing (container[index]
) operation
impl IndexMut<usize> for Dim<[Ix; 3]>
[src]
fn index_mut(&mut self, index: usize) -> &mut Self::Output
The method for the mutable indexing (container[index]
) operation
impl Zero for Dim<[Ix; 3]>
[src]
fn zero() -> Self
Returns the additive identity element of Self
, 0
. Read more
fn is_zero(&self) -> bool
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
The method for the indexing (container[index]
) operation
impl IndexMut<usize> for Dim<[Ix; 4]>
[src]
fn index_mut(&mut self, index: usize) -> &mut Self::Output
The method for the mutable indexing (container[index]
) operation
impl Zero for Dim<[Ix; 4]>
[src]
fn zero() -> Self
Returns the additive identity element of Self
, 0
. Read more
fn is_zero(&self) -> bool
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
The method for the indexing (container[index]
) operation
impl IndexMut<usize> for Dim<[Ix; 5]>
[src]
fn index_mut(&mut self, index: usize) -> &mut Self::Output
The method for the mutable indexing (container[index]
) operation
impl Zero for Dim<[Ix; 5]>
[src]
fn zero() -> Self
Returns the additive identity element of Self
, 0
. Read more
fn is_zero(&self) -> bool
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
The method for the indexing (container[index]
) operation
impl IndexMut<usize> for Dim<[Ix; 6]>
[src]
fn index_mut(&mut self, index: usize) -> &mut Self::Output
The method for the mutable indexing (container[index]
) operation
impl Zero for Dim<[Ix; 6]>
[src]
fn zero() -> Self
Returns the additive identity element of Self
, 0
. Read more
fn is_zero(&self) -> bool
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>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<I: PartialEq + ?Sized> PartialEq for Dim<I>
[src]
fn eq(&self, __arg_0: &Dim<I>) -> bool
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
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]
fn eq(&self, rhs: &I) -> bool
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
This method tests for !=
.
impl<I> Debug for Dim<I> where I: Debug
[src]
impl<I> Add for Dim<I> where Dim<I>: Dimension
[src]
type Output = Self
The resulting type after applying the +
operator
fn add(self, rhs: Self) -> Self
The method for the +
operator
impl<I> AddAssign for Dim<I> where Dim<I>: Dimension
[src]
fn add_assign(&mut self, rhs: Self)
The method for the +=
operator
impl<'a, I> AddAssign<&'a Dim<I>> for Dim<I> where Dim<I>: Dimension
[src]
fn add_assign(&mut self, rhs: &Self)
The method for the +=
operator
impl Add<Ix> for Dim<[Ix; 1]>
[src]
type Output = Self
The resulting type after applying the +
operator
fn add(self, rhs: Ix) -> Self
The method for the +
operator
impl AddAssign<Ix> for Dim<[Ix; 1]>
[src]
fn add_assign(&mut self, rhs: Ix)
The method for the +=
operator
impl<I> Sub for Dim<I> where Dim<I>: Dimension
[src]
type Output = Self
The resulting type after applying the -
operator
fn sub(self, rhs: Self) -> Self
The method for the -
operator
impl<I> SubAssign for Dim<I> where Dim<I>: Dimension
[src]
fn sub_assign(&mut self, rhs: Self)
The method for the -=
operator
impl<'a, I> SubAssign<&'a Dim<I>> for Dim<I> where Dim<I>: Dimension
[src]
fn sub_assign(&mut self, rhs: &Self)
The method for the -=
operator
impl Sub<Ix> for Dim<[Ix; 1]>
[src]
type Output = Self
The resulting type after applying the -
operator
fn sub(self, rhs: Ix) -> Self
The method for the -
operator
impl SubAssign<Ix> for Dim<[Ix; 1]>
[src]
fn sub_assign(&mut self, rhs: Ix)
The method for the -=
operator
impl<I> Mul for Dim<I> where Dim<I>: Dimension
[src]
type Output = Self
The resulting type after applying the *
operator
fn mul(self, rhs: Self) -> Self
The method for the *
operator
impl<I> MulAssign for Dim<I> where Dim<I>: Dimension
[src]
fn mul_assign(&mut self, rhs: Self)
The method for the *=
operator
impl<'a, I> MulAssign<&'a Dim<I>> for Dim<I> where Dim<I>: Dimension
[src]
fn mul_assign(&mut self, rhs: &Self)
The method for the *=
operator
impl<I> Mul<Ix> for Dim<I> where Dim<I>: Dimension
[src]
type Output = Self
The resulting type after applying the *
operator
fn mul(self, rhs: Ix) -> Self
The method for the *
operator
impl<I> MulAssign<Ix> for Dim<I> where Dim<I>: Dimension
[src]
fn mul_assign(&mut self, rhs: Ix)
The method for the *=
operator
impl<J> Index<J> for Dim<Vec<usize>> where Vec<usize>: Index<J>
[src]
type Output = Vec<usize>::Output
The returned type after indexing
fn index(&self, index: J) -> &Self::Output
The method for the indexing (container[index]
) operation
impl<J> IndexMut<J> for Dim<Vec<usize>> where Vec<usize>: IndexMut<J>
[src]
fn index_mut(&mut self, index: J) -> &mut Self::Output
The method for the mutable indexing (container[index]
) operation