tatami_stats
Matrix statistics for tatami
|
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) |
Running sums from sparse data.
Compute running sums from sparse data. This is the counterpart to RunningDense
, but for sparse observed vectors.
Output_ | Type of the output data. |
Value_ | Type of the input value. |
Index_ | Type of the row/column indices. |
|
inline |
[out] | sum | Pointer 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_nan | See Options::skip_nan for details. | |
subtract | Offset 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. |
|
inline |
Add the next observed vector to the running sums.
[in] | value | Value of structural non-zero elements. |
[in] | index | Index of structural non-zero elements. This does not have to be sorted. |
number | Number of non-zero elements in value and index . |