pub struct SparseColumnRunningStatistics<T>where
T: Float,{ /* private fields */ }Expand description
Running statistics computed per-column directly from sparse (CSC) input.
Unlike SparseRunningStatistics which tracks per-row statistics across
columns, this tracks per-column statistics: nnz, sum, and sum-of-squares
for each column. Mean/variance use nrows as the denominator (implicit
zeros contribute zero values).
CSC slabs are consumed directly — no triplet materialization — and each slab only needs to know its starting column offset in the global index space.
Implementations§
Source§impl<T> SparseColumnRunningStatistics<T>
impl<T> SparseColumnRunningStatistics<T>
Sourcepub fn new(ncols: usize, nrows: usize) -> Self
pub fn new(ncols: usize, nrows: usize) -> Self
Create a new per-column running statistics accumulator.
§Arguments
ncols— total number of columns whose statistics will be trackednrows— row denominator used for mean/variance (number of rows considered; for a row-filtered scan this should be the number of rows kept)
Sourcepub fn add_csc(&mut self, csc: &CscMatrix<T>, col_offset: usize)
pub fn add_csc(&mut self, csc: &CscMatrix<T>, col_offset: usize)
Accumulate statistics from a CSC slab. col_offset is the global
column index of the slab’s local column 0.
Sourcepub fn add_csc_masked(
&mut self,
csc: &CscMatrix<T>,
col_offset: usize,
row_mask: &[bool],
)
pub fn add_csc_masked( &mut self, csc: &CscMatrix<T>, col_offset: usize, row_mask: &[bool], )
Accumulate statistics from a CSC slab, keeping only rows where
row_mask[row] is true. row_mask must cover every row index
appearing in the CSC (length ≥ csc.nrows()).
pub fn ncols(&self) -> usize
pub fn nrows(&self) -> usize
Trait Implementations§
Source§impl<T> Clone for SparseColumnRunningStatistics<T>
impl<T> Clone for SparseColumnRunningStatistics<T>
Source§impl<T> RunningStatOps<T> for SparseColumnRunningStatistics<T>
impl<T> RunningStatOps<T> for SparseColumnRunningStatistics<T>
Auto Trait Implementations§
impl<T> Freeze for SparseColumnRunningStatistics<T>
impl<T> RefUnwindSafe for SparseColumnRunningStatistics<T>where
Vec<T>: RefUnwindSafe,
impl<T> Send for SparseColumnRunningStatistics<T>
impl<T> Sync for SparseColumnRunningStatistics<T>
impl<T> Unpin for SparseColumnRunningStatistics<T>
impl<T> UnsafeUnpin for SparseColumnRunningStatistics<T>where
Vec<T>: UnsafeUnpin,
impl<T> UnwindSafe for SparseColumnRunningStatistics<T>where
Vec<T>: UnwindSafe,
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
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> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.