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 Index<usize> for Dim<[Ix; 0]>
[src]

The returned type after indexing

The method for the indexing (container[index]) operation

impl IndexMut<usize> for Dim<[Ix; 0]>
[src]

The method for the mutable indexing (container[index]) operation

impl Zero for Dim<[Ix; 0]>
[src]

Returns the additive identity element of Self, 0. Read more

Returns true if self is equal to the additive identity.

impl Index<usize> for Dim<[Ix; 1]>
[src]

The returned type after indexing

The method for the indexing (container[index]) operation

impl IndexMut<usize> for Dim<[Ix; 1]>
[src]

The method for the mutable indexing (container[index]) operation

impl Zero for Dim<[Ix; 1]>
[src]

Returns the additive identity element of Self, 0. Read more

Returns true if self is equal to the additive identity.

impl Index<usize> for Dim<[Ix; 2]>
[src]

The returned type after indexing

The method for the indexing (container[index]) operation

impl IndexMut<usize> for Dim<[Ix; 2]>
[src]

The method for the mutable indexing (container[index]) operation

impl Zero for Dim<[Ix; 2]>
[src]

Returns the additive identity element of Self, 0. Read more

Returns true if self is equal to the additive identity.

impl Index<usize> for Dim<[Ix; 3]>
[src]

The returned type after indexing

The method for the indexing (container[index]) operation

impl IndexMut<usize> for Dim<[Ix; 3]>
[src]

The method for the mutable indexing (container[index]) operation

impl Zero for Dim<[Ix; 3]>
[src]

Returns the additive identity element of Self, 0. Read more

Returns true if self is equal to the additive identity.

impl Index<usize> for Dim<[Ix; 4]>
[src]

The returned type after indexing

The method for the indexing (container[index]) operation

impl IndexMut<usize> for Dim<[Ix; 4]>
[src]

The method for the mutable indexing (container[index]) operation

impl Zero for Dim<[Ix; 4]>
[src]

Returns the additive identity element of Self, 0. Read more

Returns true if self is equal to the additive identity.

impl Index<usize> for Dim<[Ix; 5]>
[src]

The returned type after indexing

The method for the indexing (container[index]) operation

impl IndexMut<usize> for Dim<[Ix; 5]>
[src]

The method for the mutable indexing (container[index]) operation

impl Zero for Dim<[Ix; 5]>
[src]

Returns the additive identity element of Self, 0. Read more

Returns true if self is equal to the additive identity.

impl Index<usize> for Dim<[Ix; 6]>
[src]

The returned type after indexing

The method for the indexing (container[index]) operation

impl IndexMut<usize> for Dim<[Ix; 6]>
[src]

The method for the mutable indexing (container[index]) operation

impl Zero for Dim<[Ix; 6]>
[src]

Returns the additive identity element of Self, 0. Read more

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]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<I: PartialEq + ?Sized> PartialEq for Dim<I>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<I: Eq + ?Sized> Eq for Dim<I>
[src]

impl<I: Default + ?Sized> Default for Dim<I>
[src]

Returns the "default value" for a type. Read more

impl<I: ?Sized> PartialEq<I> for Dim<I> where I: PartialEq
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<I> Debug for Dim<I> where I: Debug
[src]

Formats the value using the given formatter.

impl<I> Add for Dim<I> where Dim<I>: Dimension
[src]

The resulting type after applying the + operator

The method for the + operator

impl<I> AddAssign for Dim<I> where Dim<I>: Dimension
[src]

The method for the += operator

impl<'a, I> AddAssign<&'a Dim<I>> for Dim<I> where Dim<I>: Dimension
[src]

The method for the += operator

impl Add<Ix> for Dim<[Ix; 1]>
[src]

The resulting type after applying the + operator

The method for the + operator

impl AddAssign<Ix> for Dim<[Ix; 1]>
[src]

The method for the += operator

impl<I> Sub for Dim<I> where Dim<I>: Dimension
[src]

The resulting type after applying the - operator

The method for the - operator

impl<I> SubAssign for Dim<I> where Dim<I>: Dimension
[src]

The method for the -= operator

impl<'a, I> SubAssign<&'a Dim<I>> for Dim<I> where Dim<I>: Dimension
[src]

The method for the -= operator

impl Sub<Ix> for Dim<[Ix; 1]>
[src]

The resulting type after applying the - operator

The method for the - operator

impl SubAssign<Ix> for Dim<[Ix; 1]>
[src]

The method for the -= operator

impl<I> Mul for Dim<I> where Dim<I>: Dimension
[src]

The resulting type after applying the * operator

The method for the * operator

impl<I> MulAssign for Dim<I> where Dim<I>: Dimension
[src]

The method for the *= operator

impl<'a, I> MulAssign<&'a Dim<I>> for Dim<I> where Dim<I>: Dimension
[src]

The method for the *= operator

impl<I> Mul<Ix> for Dim<I> where Dim<I>: Dimension
[src]

The resulting type after applying the * operator

The method for the * operator

impl<I> MulAssign<Ix> for Dim<I> where Dim<I>: Dimension
[src]

The method for the *= operator

impl Dimension for Dim<[Ix; 0]>
[src]

SliceArg is the type which is used to specify slicing for this dimension. Read more

Pattern matching friendly form of the dimension value. Read more

Convert the dimension into a pattern matching friendly value.

Compute the size of the dimension (number of elements)

Compute the size while checking for overflow.

Borrow as a read-only array view.

Borrow as a read-write array view.

impl Dimension for Dim<[Ix; 1]>
[src]

SliceArg is the type which is used to specify slicing for this dimension. Read more

Pattern matching friendly form of the dimension value. Read more

Convert the dimension into a pattern matching friendly value.

Compute the size of the dimension (number of elements)

Compute the size while checking for overflow.

Borrow as a read-only array view.

Borrow as a read-write array view.

impl Dimension for Dim<[Ix; 2]>
[src]

SliceArg is the type which is used to specify slicing for this dimension. Read more

Pattern matching friendly form of the dimension value. Read more

Convert the dimension into a pattern matching friendly value.

Compute the size of the dimension (number of elements)

Compute the size while checking for overflow.

Borrow as a read-only array view.

Borrow as a read-write array view.

impl Dimension for Dim<[Ix; 3]>
[src]

SliceArg is the type which is used to specify slicing for this dimension. Read more

Pattern matching friendly form of the dimension value. Read more

Convert the dimension into a pattern matching friendly value.

Compute the size of the dimension (number of elements)

Compute the size while checking for overflow.

Borrow as a read-only array view.

Borrow as a read-write array view.

impl Dimension for Dim<[Ix; 4]>
[src]

SliceArg is the type which is used to specify slicing for this dimension. Read more

Pattern matching friendly form of the dimension value. Read more

Convert the dimension into a pattern matching friendly value.

Compute the size of the dimension (number of elements)

Compute the size while checking for overflow.

Borrow as a read-only array view.

Borrow as a read-write array view.

impl Dimension for Dim<[Ix; 5]>
[src]

SliceArg is the type which is used to specify slicing for this dimension. Read more

Pattern matching friendly form of the dimension value. Read more

Convert the dimension into a pattern matching friendly value.

Compute the size of the dimension (number of elements)

Compute the size while checking for overflow.

Borrow as a read-only array view.

Borrow as a read-write array view.

impl Dimension for Dim<[Ix; 6]>
[src]

SliceArg is the type which is used to specify slicing for this dimension. Read more

Pattern matching friendly form of the dimension value. Read more

Convert the dimension into a pattern matching friendly value.

Compute the size of the dimension (number of elements)

Compute the size while checking for overflow.

Borrow as a read-only array view.

Borrow as a read-write array view.

impl<J> Index<J> for Dim<Vec<usize>> where Vec<usize>: Index<J>
[src]

The returned type after indexing

The method for the indexing (container[index]) operation

impl<J> IndexMut<J> for Dim<Vec<usize>> where Vec<usize>: IndexMut<J>
[src]

The method for the mutable indexing (container[index]) operation

impl NdIndex<IxDyn> for Dim<[Ix; 1]>
[src]

impl NdIndex<IxDyn> for Dim<[Ix; 2]>
[src]

impl NdIndex<IxDyn> for Dim<[Ix; 3]>
[src]

impl NdIndex<IxDyn> for Dim<[Ix; 4]>
[src]

impl NdIndex<IxDyn> for Dim<[Ix; 5]>
[src]

impl NdIndex<IxDyn> for Dim<[Ix; 6]>
[src]

impl RemoveAxis for Dim<[Ix; 1]>
[src]

impl RemoveAxis for Dim<[Ix; 2]>
[src]

impl RemoveAxis for Dim<[Ix; 3]>
[src]

impl RemoveAxis for Dim<[Ix; 4]>
[src]

impl RemoveAxis for Dim<[Ix; 5]>
[src]

impl RemoveAxis for Dim<[Ix; 6]>
[src]

impl RemoveAxis for Dim<Vec<Ix>>
[src]