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
Trait Implementations
Performs the +=
operation. Read more
Performs the +=
operation. Read more
Performs the +=
operation. 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
type SliceArg = [SliceOrIndex; 0]
type SliceArg = [SliceOrIndex; 0]
SliceArg
is the type which is used to specify slicing for this
dimension. Read more
type Smaller = Self
type Smaller = Self
Next smaller dimension (if applicable)
Convert the dimension into a pattern matching friendly value.
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.
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
type SliceArg = [SliceOrIndex; 1]
type SliceArg = [SliceOrIndex; 1]
SliceArg
is the type which is used to specify slicing for this
dimension. Read more
Convert the dimension into a pattern matching friendly value.
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.
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
type SliceArg = [SliceOrIndex; 2]
type SliceArg = [SliceOrIndex; 2]
SliceArg
is the type which is used to specify slicing for this
dimension. Read more
Convert the dimension into a pattern matching friendly value.
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.
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
type SliceArg = [SliceOrIndex; 3]
type SliceArg = [SliceOrIndex; 3]
SliceArg
is the type which is used to specify slicing for this
dimension. Read more
Convert the dimension into a pattern matching friendly value.
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.
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
type SliceArg = [SliceOrIndex; 4]
type SliceArg = [SliceOrIndex; 4]
SliceArg
is the type which is used to specify slicing for this
dimension. Read more
Convert the dimension into a pattern matching friendly value.
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.
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
type SliceArg = [SliceOrIndex; 5]
type SliceArg = [SliceOrIndex; 5]
SliceArg
is the type which is used to specify slicing for this
dimension. Read more
Convert the dimension into a pattern matching friendly value.
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.
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
type SliceArg = [SliceOrIndex; 6]
type SliceArg = [SliceOrIndex; 6]
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
Convert the dimension into a pattern matching friendly value.
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.
This trait is private to implement; this method exists to make it impossible to implement outside the crate. Read more
Performs the *=
operation. Read more
Performs the *=
operation. Read more
Performs the *=
operation. Read more
Performs the -=
operation. Read more
Performs the -=
operation. Read more
Performs the -=
operation. Read more
Auto Trait Implementations
impl<I: ?Sized> RefUnwindSafe for Dim<I> where
I: RefUnwindSafe,
impl<I: ?Sized> UnwindSafe for Dim<I> where
I: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more