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

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 ()
 

Detailed Description

template<bool minimum_, typename Output_, typename Value_, typename Index_>
class tatami_stats::ranges::RunningSparse< minimum_, Output_, Value_, Index_ >

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.

Template Parameters
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.

Constructor & Destructor Documentation

◆ RunningSparse()

template<bool minimum_, typename Output_ , typename Value_ , typename Index_ >
tatami_stats::ranges::RunningSparse< minimum_, Output_, Value_, Index_ >::RunningSparse ( Index_  num,
Output_ *  store,
bool  skip_nan,
Index_  subtract = 0 
)
inline
Parameters
numNumber of objective vectors.
[out]storePointer to an output array of length num. After finish() is called, this will contain the minimum/maximum for each objective vector.
skip_nanSee Options::skip_nan for details.
subtractOffset 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.

Member Function Documentation

◆ add()

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

Add the next observed vector to the min/max calculation.

Parameters
[in]valueValue of structural non-zero elements.
[in]indexIndex of structural non-zero elements.
numberNumber of non-zero elements in value and index.

◆ finish()

template<bool minimum_, typename Output_ , typename Value_ , typename Index_ >
void tatami_stats::ranges::RunningSparse< minimum_, Output_, Value_, Index_ >::finish ( )
inline

Finish the min/max calculation once all observed vectors have been passed to add().


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