pub enum AnyDataArray {
F32(DataArray<f32>),
F64(DataArray<f64>),
I8(DataArray<i8>),
I16(DataArray<i16>),
I32(DataArray<i32>),
I64(DataArray<i64>),
U8(DataArray<u8>),
U16(DataArray<u16>),
U32(DataArray<u32>),
U64(DataArray<u64>),
}Expand description
Type-erased data array that can hold any scalar type.
Uses an enum rather than trait objects for exhaustive matching and zero vtable overhead.
Variants§
F32(DataArray<f32>)
F64(DataArray<f64>)
I8(DataArray<i8>)
I16(DataArray<i16>)
I32(DataArray<i32>)
I64(DataArray<i64>)
U8(DataArray<u8>)
U16(DataArray<u16>)
U32(DataArray<u32>)
U64(DataArray<u64>)
Implementations§
Source§impl AnyDataArray
impl AnyDataArray
pub fn name(&self) -> &str
pub fn set_name(&mut self, name: &str)
pub fn scalar_type(&self) -> ScalarType
Sourcepub fn clone_with_name(&self, name: &str) -> Self
pub fn clone_with_name(&self, name: &str) -> Self
Clone this array with a different name.
pub fn num_components(&self) -> usize
pub fn num_tuples(&self) -> usize
Sourcepub fn tuple_as_f64(&self, idx: usize, out: &mut [f64])
pub fn tuple_as_f64(&self, idx: usize, out: &mut [f64])
Get tuple values as f64 (type-erased access).
Sourcepub fn statistics(&self) -> Option<ArrayStatistics>
pub fn statistics(&self) -> Option<ArrayStatistics>
Compute statistics (min, max, mean, variance) of the first component.
Returns (min, max, mean, variance). Returns None if the array is empty.
Sourcepub fn to_f64_vec(&self) -> Vec<f64>
pub fn to_f64_vec(&self) -> Vec<f64>
Extract all values as a Vec
Convenient for analysis workflows. For multi-component arrays, only the first component is returned.
Sourcepub fn to_f64_vec_flat(&self) -> Vec<f64>
pub fn to_f64_vec_flat(&self) -> Vec<f64>
Extract all values as a flat Vec
Trait Implementations§
Source§impl Clone for AnyDataArray
impl Clone for AnyDataArray
Source§fn clone(&self) -> AnyDataArray
fn clone(&self) -> AnyDataArray
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AnyDataArray
impl Debug for AnyDataArray
Source§impl Display for AnyDataArray
impl Display for AnyDataArray
Source§impl PartialEq for AnyDataArray
impl PartialEq for AnyDataArray
impl StructuralPartialEq for AnyDataArray
Auto Trait Implementations§
impl Freeze for AnyDataArray
impl RefUnwindSafe for AnyDataArray
impl Send for AnyDataArray
impl Sync for AnyDataArray
impl Unpin for AnyDataArray
impl UnsafeUnpin for AnyDataArray
impl UnwindSafe for AnyDataArray
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more