tatami_stats
Matrix statistics for tatami
|
Running minima/maxima from sparse data. More...
#include <ranges.hpp>
Public Member Functions | |
RunningSparse (Index_ num, Output_ *store, bool skip_nan, Index_ subtract=0) | |
void | add (const Value_ *value, const Index_ *index, Index_ number) |
void | finish () |
Running minima/maxima from sparse data.
Compute running minima and maximuma from sparse data. This does the same as RunningDense
but for sparse observed vectors.
minimum_ | Whether to compute the minimum. If false, the maximum is computed instead. |
Output_ | Type of the output data. |
Value_ | Type of the input value. |
Index_ | Type of the row/column indices. |
|
inline |
num | Number of objective vectors. | |
[out] | store | Pointer to an output array of length num . After finish() is called, this will contain the minimum/maximum for each objective vector. |
skip_nan | See Options::skip_nan for details. | |
subtract | Offset to subtract from each element of index before using it to index into store . Only relevant if store holds statistics for a contiguous subset of objective vectors, e.g., during task allocation for parallelization. |
|
inline |
Add the next observed vector to the min/max calculation.
[in] | value | Value of structural non-zero elements. |
[in] | index | Index of structural non-zero elements. |
number | Number of non-zero elements in value and index . |
|
inline |
Finish the min/max calculation once all observed vectors have been passed to add()
.