pub type StridedDynArray<Item, const NDIM: usize> = Array<StridedBaseArray<VectorContainer<Item>, NDIM>, NDIM>;Expand description
A heap-allocated array with an explicit non-overlapping stride.
Logical iteration remains column-major even when the physical storage layout is not.
Aliased Type§
pub struct StridedDynArray<Item, const NDIM: usize>(/* private fields */);Implementations§
Source§impl<Item: Copy + Default, const NDIM: usize> StridedDynArray<Item, NDIM>
impl<Item: Copy + Default, const NDIM: usize> StridedDynArray<Item, NDIM>
Sourcepub fn from_shape_and_stride(
shape: [usize; NDIM],
stride: [usize; NDIM],
) -> Self
pub fn from_shape_and_stride( shape: [usize; NDIM], stride: [usize; NDIM], ) -> Self
Allocate an array with an explicit physical stride.
The allocation spans through the greatest reachable storage offset. Strides must map every logical index to a distinct storage element.
§Panics
Panics if two computed logical offsets are equal. Shape/stride arithmetic uses ordinary
usize operations, so callers must provide metadata whose products, offsets, and storage
span are representable.
Source§impl<Item, const NDIM: usize> StridedDynArray<Item, NDIM>
impl<Item, const NDIM: usize> StridedDynArray<Item, NDIM>
Sourcepub fn new_from<ArrayImpl>(
stride: [usize; NDIM],
arr: &Array<ArrayImpl, NDIM>,
) -> Selfwhere
ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<NDIM>,
pub fn new_from<ArrayImpl>(
stride: [usize; NDIM],
arr: &Array<ArrayImpl, NDIM>,
) -> Selfwhere
ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<NDIM>,
Create a new strided array with stride and fill with values from arr.
Sourcepub fn row_major_from<ArrayImpl>(arr: &Array<ArrayImpl, NDIM>) -> Selfwhere
ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<NDIM>,
pub fn row_major_from<ArrayImpl>(arr: &Array<ArrayImpl, NDIM>) -> Selfwhere
ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<NDIM>,
Create a new row-major array from existing array arr.