[][src]Struct ndarray::Dim

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.

Performs the indexing (container[index]) operation.

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

Performs 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.

Performs the indexing (container[index]) operation.

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

Performs 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.

Performs the indexing (container[index]) operation.

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

Performs 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.

Performs the indexing (container[index]) operation.

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

Performs 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.

Performs the indexing (container[index]) operation.

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

Performs 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.

Performs the indexing (container[index]) operation.

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

Performs 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.

Performs the indexing (container[index]) operation.

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

Performs 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: ?Sized> Hash for Dim<I> where
    Dim<I>: Dimension
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

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

Formats the value using the given formatter. Read more

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

The resulting type after applying the + operator.

Performs the + operation.

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

Performs the += operation.

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

Performs the += operation.

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

The resulting type after applying the + operator.

Performs the + operation.

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

Performs the += operation.

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

The resulting type after applying the - operator.

Performs the - operation.

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

Performs the -= operation.

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

Performs the -= operation.

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

The resulting type after applying the - operator.

Performs the - operation.

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

Performs the -= operation.

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

The resulting type after applying the * operator.

Performs the * operation.

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

Performs the *= operation.

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

Performs the *= operation.

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

The resulting type after applying the * operator.

Performs the * operation.

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

Performs the *= operation.

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

For fixed-size dimension representations (e.g. Ix2), this should be Some(ndim), and for variable-size dimension representations (e.g. IxDyn), this should be None. Read more

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

Next smaller dimension (if applicable)

Next larger dimension

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.

Convert the dimensional into a dynamic dimensional (IxDyn).

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]

For fixed-size dimension representations (e.g. Ix2), this should be Some(ndim), and for variable-size dimension representations (e.g. IxDyn), this should be None. Read more

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

Next smaller dimension (if applicable)

Next larger dimension

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.

Convert the dimensional into a dynamic dimensional (IxDyn).

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]

For fixed-size dimension representations (e.g. Ix2), this should be Some(ndim), and for variable-size dimension representations (e.g. IxDyn), this should be None. Read more

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

Next smaller dimension (if applicable)

Next larger dimension

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.

Convert the dimensional into a dynamic dimensional (IxDyn).

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]

For fixed-size dimension representations (e.g. Ix2), this should be Some(ndim), and for variable-size dimension representations (e.g. IxDyn), this should be None. Read more

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

Next smaller dimension (if applicable)

Next larger dimension

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.

Convert the dimensional into a dynamic dimensional (IxDyn).

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]

For fixed-size dimension representations (e.g. Ix2), this should be Some(ndim), and for variable-size dimension representations (e.g. IxDyn), this should be None. Read more

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

Next smaller dimension (if applicable)

Next larger dimension

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.

Convert the dimensional into a dynamic dimensional (IxDyn).

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]

For fixed-size dimension representations (e.g. Ix2), this should be Some(ndim), and for variable-size dimension representations (e.g. IxDyn), this should be None. Read more

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

Next smaller dimension (if applicable)

Next larger dimension

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.

Convert the dimensional into a dynamic dimensional (IxDyn).

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]

For fixed-size dimension representations (e.g. Ix2), this should be Some(ndim), and for variable-size dimension representations (e.g. IxDyn), this should be None. Read more

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

Next smaller dimension (if applicable)

Next larger dimension

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.

Convert the dimensional into a dynamic dimensional (IxDyn).

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]

The returned type after indexing.

Performs the indexing (container[index]) operation.

impl IndexMut<usize> for Dim<IxDynImpl>
[src]

Performs the mutable indexing (container[index]) operation.

impl RemoveAxis for Dim<IxDynImpl>
[src]

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

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]

Auto Trait Implementations

impl<I: ?Sized> Send for Dim<I> where
    I: Send

impl<I: ?Sized> Sync for Dim<I> where
    I: Sync

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> From for T
[src]

Performs the conversion.

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Immutably borrows from an owned value. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Mutably borrows from an owned value. Read more

impl<T> Any for T where
    T: 'static + ?Sized
[src]

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more