Struct vortex::array::SparseArray

source ·
pub struct SparseArray { /* private fields */ }

Implementations§

source§

impl SparseArray

source

pub fn len(&self) -> usize

source

pub fn is_empty(&self) -> bool

source§

impl SparseArray

source

pub fn try_new( indices: Array, values: Array, len: usize, fill_value: Scalar, ) -> VortexResult<Self>

source

pub fn indices_offset(&self) -> usize

source

pub fn values(&self) -> Array

source

pub fn indices(&self) -> Array

source

pub fn fill_value(&self) -> &Scalar

source

pub fn resolved_indices(&self) -> Vec<usize>

Return indices as a vector of usize with the indices_offset applied.

source

pub fn min_index(&self) -> Option<usize>

Return the minimum index if indices are present.

If this sparse array has no indices (i.e. all elements are equal to fill_value) then it returns None.

Trait Implementations§

source§

impl AcceptArrayVisitor for SparseArray

source§

fn accept(&self, visitor: &mut dyn ArrayVisitor) -> VortexResult<()>

source§

impl ArrayCompute for SparseArray

source§

fn scalar_at(&self) -> Option<&dyn ScalarAtFn>

Single item indexing on Vortex arrays. Read more
source§

fn search_sorted(&self) -> Option<&dyn SearchSortedFn>

Perform a search over an ordered array. Read more
source§

fn slice(&self) -> Option<&dyn SliceFn>

Perform zero-copy slicing of an array. Read more
source§

fn take(&self) -> Option<&dyn TakeFn>

Take a set of indices from an array. This often forces allocations and decoding of the receiver. Read more
source§

fn filter(&self) -> Option<&dyn FilterFn>

Filtering function on arrays of predicates. Read more
source§

fn cast(&self) -> Option<&dyn CastFn>

Implemented for arrays that can be casted to different types. Read more
source§

fn compare( &self, _other: &Array, _operator: Operator, ) -> Option<VortexResult<Array>>

Binary operator implementation for arrays against other arrays. Read more
source§

fn fill_forward(&self) -> Option<&dyn FillForwardFn>

Array function that returns new arrays a non-null value is repeated across runs of nulls. Read more
source§

fn subtract_scalar(&self) -> Option<&dyn SubtractScalarFn>

Broadcast subtraction of scalar from Vortex array. Read more
source§

fn and(&self) -> Option<&dyn AndFn>

Perform a boolean AND operation over two arrays Read more
source§

fn or(&self) -> Option<&dyn OrFn>

Perform a boolean OR operation over two arrays Read more
source§

impl ArrayStatisticsCompute for SparseArray

source§

fn compute_statistics(&self, _stat: Stat) -> VortexResult<StatsSet>

Compute the requested statistic. Can return additional stats.
source§

impl ArrayTrait for SparseArray

source§

fn nbytes(&self) -> usize

source§

impl ArrayValidity for SparseArray

source§

impl ArrayVariants for SparseArray

Sparse arrays support all DTypes

source§

impl AsRef<Array> for SparseArray

source§

fn as_ref(&self) -> &Array

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl BoolArrayTrait for SparseArray

source§

impl Clone for SparseArray

source§

fn clone(&self) -> SparseArray

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SparseArray

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl ExtensionArrayTrait for SparseArray

source§

impl FilterFn for SparseArray

source§

fn filter(&self, predicate: &Array) -> VortexResult<Array>

Filter an array by the provided predicate.
source§

impl From<SparseArray> for Array

source§

fn from(value: SparseArray) -> Array

Converts to this type from the input type.
source§

impl From<TypedArray<Sparse>> for SparseArray

source§

fn from(typed: TypedArray<Sparse>) -> Self

Converts to this type from the input type.
source§

impl GetArrayMetadata for SparseArray

source§

impl<'a> IntoArray for SparseArray

source§

impl IntoCanonical for SparseArray

source§

impl PrimitiveArrayTrait for SparseArray

source§

impl ScalarAtFn for SparseArray

source§

impl SearchSortedFn for SparseArray

source§

fn search_sorted( &self, value: &Scalar, side: SearchSortedSide, ) -> VortexResult<SearchResult>

source§

fn search_sorted_u64( &self, value: u64, side: SearchSortedSide, ) -> VortexResult<SearchResult>

source§

fn search_sorted_many( &self, values: &[Scalar], sides: &[SearchSortedSide], ) -> VortexResult<Vec<SearchResult>>

Bulk search for many values.
source§

fn search_sorted_u64_many( &self, values: &[u64], sides: &[SearchSortedSide], ) -> VortexResult<Vec<SearchResult>>

source§

impl SliceFn for SparseArray

source§

fn slice(&self, start: usize, stop: usize) -> VortexResult<Array>

Return a zero-copy slice of an array, between start (inclusive) and end (exclusive). If start >= stop, returns an empty array of the same type as self. Assumes that start or stop are out of bounds, may panic otherwise.
source§

impl StructArrayTrait for SparseArray

source§

fn field(&self, idx: usize) -> Option<Array>

source§

fn names(&self) -> &FieldNames

source§

fn dtypes(&self) -> &[DType]

source§

fn nfields(&self) -> usize

source§

fn field_by_name(&self, name: &str) -> Option<Array>

source§

impl TakeFn for SparseArray

source§

fn take(&self, indices: &Array) -> VortexResult<Array>

source§

impl ToArray for SparseArray

source§

fn to_array(&self) -> Array

source§

impl TryFrom<&Array> for SparseArray

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(array: &Array) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Array> for SparseArray

source§

type Error = VortexError

The type returned in the event of a conversion error.
source§

fn try_from(array: Array) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl BinaryArrayTrait for SparseArray

source§

impl ListArrayTrait for SparseArray

source§

impl NullArrayTrait for SparseArray

source§

impl Utf8ArrayTrait for SparseArray

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> ArrayDType for T
where T: AsRef<Array>,

source§

fn dtype(&self) -> &DType

source§

impl<T> ArrayEncodingRef for T
where T: AsRef<Array>,

source§

fn encoding(&self) -> &'static dyn ArrayEncoding

source§

impl<T> ArrayLen for T
where T: AsRef<Array>,

source§

fn len(&self) -> usize

source§

fn is_empty(&self) -> bool

source§

impl<T> ArrayStatistics for T
where T: AsRef<Array>,

source§

fn statistics(&self) -> &dyn Statistics

source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoArrayVariant for T
where T: IntoCanonical,

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<D> ToArrayData for D

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.