Struct ndarray::Dim[][src]

pub struct Dim<I: ?Sized> { /* fields omitted */ }
Expand description

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]));

Implementations

Create a new dimension value with n axes, all zeros

Trait Implementations

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the + operator.

Performs the + operation. Read more

Performs the += operation. Read more

Performs the += operation. Read more

Performs the += operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

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

Returns the number of dimensions (number of axes).

Convert the dimension into a pattern matching friendly value.

Creates a dimension of all zeros with the specified ndim. Read more

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

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

Returns the number of dimensions (number of axes).

Convert the dimension into a pattern matching friendly value.

Creates a dimension of all zeros with the specified ndim. Read more

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

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

Returns the number of dimensions (number of axes).

Convert the dimension into a pattern matching friendly value.

Creates a dimension of all zeros with the specified ndim. Read more

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

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

Returns the number of dimensions (number of axes).

Convert the dimension into a pattern matching friendly value.

Compute the size of the dimension (number of elements)

Creates a dimension of all zeros with the specified ndim. Read more

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

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

Returns the number of dimensions (number of axes).

Convert the dimension into a pattern matching friendly value.

Creates a dimension of all zeros with the specified ndim. Read more

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

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

Returns the number of dimensions (number of axes).

Convert the dimension into a pattern matching friendly value.

Creates a dimension of all zeros with the specified ndim. Read more

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

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

Returns the number of dimensions (number of axes).

Convert the dimension into a pattern matching friendly value.

Creates a dimension of all zeros with the specified ndim. Read more

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

Feeds this value into the given Hasher. Read more

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

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

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

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

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

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

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

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

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

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

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

Performs the *= operation. Read more

Performs the *= operation. Read more

Performs the *= operation. Read more

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

This method tests for !=.

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

This method tests for !=.

The resulting type after applying the - operator.

Performs the - operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

Performs the -= operation. Read more

Performs the -= operation. Read more

Performs the -= operation. Read more

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

Returns true if self is equal to the additive identity.

Sets self to the additive identity element of Self, 0.

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

Returns true if self is equal to the additive identity.

Sets self to the additive identity element of Self, 0.

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

Returns true if self is equal to the additive identity.

Sets self to the additive identity element of Self, 0.

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

Returns true if self is equal to the additive identity.

Sets self to the additive identity element of Self, 0.

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

Returns true if self is equal to the additive identity.

Sets self to the additive identity element of Self, 0.

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

Returns true if self is equal to the additive identity.

Sets self to the additive identity element of Self, 0.

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

Returns true if self is equal to the additive identity.

Sets self to the additive identity element of Self, 0.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

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

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.