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]

Requires crate feature "serde-1"

Serialize this value into the given Serde serializer. Read more

impl<'de, I> Deserialize<'de> for Dim<I> where
    I: Deserialize<'de>, 
[src]

Requires crate feature "serde-1"

Deserialize this value from the given Serde deserializer. Read more

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

Requires crate feature "rustc-serialize"

Serialize a value using an Encoder.

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

Requires crate feature "rustc-serialize"

Deserialize a value using a Decoder.

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]

NDIM: Option<usize> = Some(0)

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]

NDIM: Option<usize> = Some(1)

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]

NDIM: Option<usize> = Some(2)

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]

NDIM: Option<usize> = Some(3)

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]

NDIM: Option<usize> = Some(4)

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]

NDIM: Option<usize> = Some(5)

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]

NDIM: Option<usize> = Some(6)

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