pub type DynArray<Item, const NDIM: usize> = Array<BaseArray<VectorContainer<Item>, NDIM>, NDIM>;Expand description
A basic dynamically allocated array.
Aliased Type§
pub struct DynArray<Item, const NDIM: usize>(/* private fields */);Implementations§
Source§impl<Item: Copy + Default, const NDIM: usize> DynArray<Item, NDIM>
impl<Item: Copy + Default, const NDIM: usize> DynArray<Item, NDIM>
Sourcepub fn from_shape(shape: [usize; NDIM]) -> Self
pub fn from_shape(shape: [usize; NDIM]) -> Self
Create a new heap allocated array from a given shape.
Sourcepub fn from_shape_and_vec(shape: [usize; NDIM], data: Vec<Item>) -> Self
pub fn from_shape_and_vec(shape: [usize; NDIM], data: Vec<Item>) -> Self
Create a new heap allocated array by providing a shape and a vector of data.
The number of elements in the vector must be compatible with the given shape. Otherwise, an assertion error is triggered.