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"

[src]

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"

[src]

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"

[src]

Serialize a value using an Encoder.

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

Requires crate feature "rustc-serialize"

[src]

Deserialize a value using a Decoder.

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

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.

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

[src]

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

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

[src]

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

[src]

Returns true if self is equal to the additive identity.

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

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.

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

[src]

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

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

[src]

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

[src]

Returns true if self is equal to the additive identity.

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

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.

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

[src]

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

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

[src]

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

[src]

Returns true if self is equal to the additive identity.

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

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.

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

[src]

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

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

[src]

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

[src]

Returns true if self is equal to the additive identity.

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

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.

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

[src]

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

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

[src]

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

[src]

Returns true if self is equal to the additive identity.

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

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.

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

[src]

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

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

[src]

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

[src]

Returns true if self is equal to the additive identity.

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

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.

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

[src]

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

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

[src]

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

[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]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

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

[src]

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

[src]

This method tests for !=.

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

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

[src]

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

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

[src]

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

1.0.0
[src]

This method tests for !=.

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

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

[src]

Performs the + operation.

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

[src]

Performs the += operation.

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

[src]

Performs the += operation.

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

The resulting type after applying the + operator.

[src]

Performs the + operation.

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

[src]

Performs the += operation.

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

The resulting type after applying the - operator.

[src]

Performs the - operation.

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

[src]

Performs the -= operation.

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

[src]

Performs the -= operation.

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

The resulting type after applying the - operator.

[src]

Performs the - operation.

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

[src]

Performs the -= operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

[src]

Performs the *= operation.

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

[src]

Performs the *= operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

[src]

Performs the *= operation.

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

Next smaller dimension (if applicable)

Next larger dimension

[src]

[src]

[src]

[src]

[src]

Convert the dimension into a pattern matching friendly value.

[src]

[src]

[src]

[src]

Compute the size of the dimension (number of elements)

[src]

Compute the size while checking for overflow.

[src]

Borrow as a read-only array view.

[src]

Borrow as a read-write array view.

[src]

Convert the dimensional into a dynamic dimensional (IxDyn).

[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]

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

[src]

[src]

[src]

[src]

Convert the dimension into a pattern matching friendly value.

[src]

[src]

[src]

Compute the size of the dimension (number of elements)

[src]

Compute the size while checking for overflow.

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

Borrow as a read-only array view.

[src]

Borrow as a read-write array view.

[src]

Convert the dimensional into a dynamic dimensional (IxDyn).

[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]

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

[src]

[src]

Convert the dimension into a pattern matching friendly value.

[src]

[src]

[src]

[src]

[src]

Compute the size of the dimension (number of elements)

[src]

Compute the size while checking for overflow.

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

Borrow as a read-only array view.

[src]

Borrow as a read-write array view.

[src]

Convert the dimensional into a dynamic dimensional (IxDyn).

[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]

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

[src]

[src]

Convert the dimension into a pattern matching friendly value.

[src]

[src]

[src]

Compute the size of the dimension (number of elements)

[src]

[src]

[src]

[src]

[src]

[src]

[src]

Compute the size while checking for overflow.

[src]

Borrow as a read-only array view.

[src]

Borrow as a read-write array view.

[src]

Convert the dimensional into a dynamic dimensional (IxDyn).

[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]

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

[src]

[src]

Convert the dimension into a pattern matching friendly value.

[src]

[src]

[src]

[src]

[src]

Compute the size of the dimension (number of elements)

[src]

Compute the size while checking for overflow.

[src]

Borrow as a read-only array view.

[src]

Borrow as a read-write array view.

[src]

Convert the dimensional into a dynamic dimensional (IxDyn).

[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]

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

[src]

[src]

Convert the dimension into a pattern matching friendly value.

[src]

[src]

[src]

[src]

[src]

Compute the size of the dimension (number of elements)

[src]

Compute the size while checking for overflow.

[src]

Borrow as a read-only array view.

[src]

Borrow as a read-write array view.

[src]

Convert the dimensional into a dynamic dimensional (IxDyn).

[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]

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

[src]

[src]

Convert the dimension into a pattern matching friendly value.

[src]

[src]

[src]

[src]

[src]

Compute the size of the dimension (number of elements)

[src]

Compute the size while checking for overflow.

[src]

Borrow as a read-only array view.

[src]

Borrow as a read-write array view.

[src]

Convert the dimensional into a dynamic dimensional (IxDyn).

[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]

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.

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

[src]

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

impl RemoveAxis for Dim<IxDynImpl>
[src]

[src]

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

[src]

[src]

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

[src]

[src]

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

[src]

[src]

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

[src]

[src]

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

[src]

[src]

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

[src]

[src]

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

[src]

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]