Type Alias numcodecs::AnyArray

source ·
pub type AnyArray = AnyArrayBase<OwnedRepr<()>>;
Expand description

An array that owns its data uniquely.

Aliased Type§

enum AnyArray {
    U8(ArrayBase<OwnedRepr<u8>, Dim<IxDynImpl>>),
    U16(ArrayBase<OwnedRepr<u16>, Dim<IxDynImpl>>),
    U32(ArrayBase<OwnedRepr<u32>, Dim<IxDynImpl>>),
    U64(ArrayBase<OwnedRepr<u64>, Dim<IxDynImpl>>),
    I8(ArrayBase<OwnedRepr<i8>, Dim<IxDynImpl>>),
    I16(ArrayBase<OwnedRepr<i16>, Dim<IxDynImpl>>),
    I32(ArrayBase<OwnedRepr<i32>, Dim<IxDynImpl>>),
    I64(ArrayBase<OwnedRepr<i64>, Dim<IxDynImpl>>),
    F32(ArrayBase<OwnedRepr<f32>, Dim<IxDynImpl>>),
    F64(ArrayBase<OwnedRepr<f64>, Dim<IxDynImpl>>),
}

Variants§

Implementations§

source§

impl AnyArray

source

pub fn zeros(dtype: AnyArrayDType, shape: &[usize]) -> Self

Create an array with zeros of dtype and shape shape.

source

pub fn with_zeros_bytes<T>( dtype: AnyArrayDType, shape: &[usize], with: impl FnOnce(&mut [u8]) -> T, ) -> (Self, T)

Create an array with zeros of dtype and shape shape, and provide mutable access to the bytes of the array.

The array is created to be contiguous and in standard order, i.e. its element order in memory corresponds to the logical order of the array’s elements.

source

pub fn into_cow(self) -> AnyCowArray<'static>

Returns an owned copy-on-write array.