Struct ndarray::Dim

source ·
pub struct Dim<I: ?Sized> { /* private fields */ }
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
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The sum of the two dimensions.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
The resulting dimension type after broadcasting.
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.
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).
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.
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).
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.
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).
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.
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).
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.
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).
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.
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).
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.
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).
Feeds this value 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 ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Dimensionality of the output array.
Returns the number of axes in the input array.
Returns the number of axes in the output array.
Dimensionality of the output array.
Returns the number of axes in the input array.
Returns the number of axes in the output array.
Dimensionality of the output array.
Returns the number of axes in the input array.
Returns the number of axes in the output array.
Dimensionality of the output array.
Returns the number of axes in the input array.
Returns the number of axes in the output array.
Dimensionality of the output array.
Returns the number of axes in the input array.
Returns the number of axes in the output array.
Dimensionality of the output array.
Returns the number of axes in the input array.
Returns the number of axes in the output array.
Dimensionality of the output array.
Returns the number of axes in the input array.
Returns the number of axes in the output array.
Dimensionality of the output array.
Returns the number of axes in the input array.
Returns the number of axes in the output array.
Dimensionality of the output array.
Returns the number of axes in the input array.
Returns the number of axes in the output array.
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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
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.