tatami_stats
Matrix statistics for tatami
Loading...
Searching...
No Matches
Public Member Functions | List of all members
tatami_stats::sums::RunningSparse< Output_, Value_, Index_ > Class Template Reference

Running sums from sparse data. More...

#include <sums.hpp>

Public Member Functions

 RunningSparse (Output_ *sum, bool skip_nan, Index_ subtract=0)
 
void add (const Value_ *value, const Index_ *index, Index_ number)
 

Detailed Description

template<typename Output_, typename Value_, typename Index_>
class tatami_stats::sums::RunningSparse< Output_, Value_, Index_ >

Running sums from sparse data.

Compute running sums from sparse data. This is the counterpart to RunningDense, but for sparse observed vectors.

Template Parameters
Output_Type of the output data.
Value_Type of the input value.
Index_Type of the row/column indices.

Constructor & Destructor Documentation

◆ RunningSparse()

template<typename Output_ , typename Value_ , typename Index_ >
tatami_stats::sums::RunningSparse< Output_, Value_, Index_ >::RunningSparse ( Output_ *  sum,
bool  skip_nan,
Index_  subtract = 0 
)
inline
Parameters
[out]sumPointer to an output array of length equal to the number of objective vectors. This should be zeroed on input, and will store the running sums after each add().
skip_nanSee Options::skip_nan for details.
subtractOffset to subtract from each element of index before using it to index into mean and friends. Only relevant if mean and friends hold statistics for a contiguous subset of objective vectors, e.g., during task allocation for parallelization.

Member Function Documentation

◆ add()

template<typename Output_ , typename Value_ , typename Index_ >
void tatami_stats::sums::RunningSparse< Output_, Value_, Index_ >::add ( const Value_ *  value,
const Index_ *  index,
Index_  number 
)
inline

Add the next observed vector to the running sums.

Parameters
[in]valueValue of structural non-zero elements.
[in]indexIndex of structural non-zero elements. This does not have to be sorted.
numberNumber of non-zero elements in value and index.

The documentation for this class was generated from the following file: