pub struct SparseColumn { /* private fields */ }Implementations§
Source§impl SparseColumn
impl SparseColumn
Sourcepub fn cell(&self, position: usize) -> &Scalar
pub fn cell(&self, position: usize) -> &Scalar
Read one logical cell without materializing the dense array.
Sourcepub fn from_parts(
dtype: SparseDType,
len: usize,
indices: Vec<usize>,
values: Vec<Scalar>,
) -> Result<Self, ColumnError>
pub fn from_parts( dtype: SparseDType, len: usize, indices: Vec<usize>, values: Vec<Scalar>, ) -> Result<Self, ColumnError>
Construct compressed storage without materializing the logical array.
Positions must be strictly increasing, in bounds, and paired with one
stored value each. Unlike from_dense, this preserves explicit entries
equal to the fill value; sparse casts and arithmetic rely on that
distinction. Values are converted to the subtype and numeric width,
while the descriptor’s fill value is retained exactly.
pub fn from_dense( dtype: SparseDType, values: Vec<Scalar>, ) -> Result<Self, ColumnError>
pub fn from_dense_column( dtype: SparseDType, column: &Column, ) -> Result<Self, ColumnError>
pub fn sparse_dtype(&self) -> &SparseDType
pub fn value_dtype(&self) -> DType
pub fn fill_value(&self) -> &Scalar
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn indices(&self) -> &[usize]
pub fn stored_values(&self) -> &[Scalar]
pub fn npoints(&self) -> usize
pub fn density(&self) -> f64
pub fn to_dense_values(&self) -> Vec<Scalar>
pub fn to_dense_column(&self) -> Result<Column, ColumnError>
Trait Implementations§
Source§impl Clone for SparseColumn
impl Clone for SparseColumn
Source§impl Debug for SparseColumn
impl Debug for SparseColumn
Source§impl<'de> Deserialize<'de> for SparseColumn
impl<'de> Deserialize<'de> for SparseColumn
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for SparseColumn
impl PartialEq for SparseColumn
Source§impl Serialize for SparseColumn
impl Serialize for SparseColumn
impl StructuralPartialEq for SparseColumn
Auto Trait Implementations§
impl !RefUnwindSafe for SparseColumn
impl !UnwindSafe for SparseColumn
impl Forget for SparseColumn
impl Freeze for SparseColumn
impl Move for SparseColumn
impl Send for SparseColumn
impl Sync for SparseColumn
impl Unpin for SparseColumn
impl UnsafeUnpin for SparseColumn
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