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

Running minima/maxima from dense data. More...

#include <ranges.hpp>

Public Member Functions

 RunningDense (Index_ num, Output_ *store, bool skip_nan)
 
void add (const Value_ *ptr)
 
void finish ()
 

Detailed Description

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

Running minima/maxima from dense data.

This considers a scenario with a set of equilength "objective" vectors \([v_1, v_2, v_3, ..., v_n]\), but data are only available for "observed" vectors \([p_1, p_2, p_3, ..., p_m]\), where the \(j\)-th element of \(p_i\) is the \(i\)-th element of \(v_j\). The idea is to repeatedly call add() for ptr corresponding to observed vectors from 0 to \(m - 1\), which computes the running minimum/maximum for each objective vector at each invocation.

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 data.
Index_Type of the row/column indices.

Constructor & Destructor Documentation

◆ RunningDense()

template<bool minimum_, typename Output_ , typename Value_ , typename Index_ >
tatami_stats::ranges::RunningDense< minimum_, Output_, Value_, Index_ >::RunningDense ( Index_  num,
Output_ *  store,
bool  skip_nan 
)
inline
Parameters
numNumber of objective vectors, i.e., \(n\).
[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.

Member Function Documentation

◆ add()

template<bool minimum_, typename Output_ , typename Value_ , typename Index_ >
void tatami_stats::ranges::RunningDense< minimum_, Output_, Value_, Index_ >::add ( const Value_ *  ptr)
inline

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

Parameters
[in]ptrPointer to an array of values of length num, corresponding to an observed vector.

◆ finish()

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

Finish the running calculation once all observed vectors have been passed to add().


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