tatami_stats
Matrix statistics for tatami
Loading...
Searching...
No Matches
Classes | Functions
tatami_stats::counts::nan Namespace Reference

Functions for counting NaNs on each dimension. More...

Classes

struct  Options
 NaN-counting options. More...
 

Functions

template<typename Value_ , typename Index_ , typename Output_ >
void apply (bool row, const tatami::Matrix< Value_, Index_ > *p, Output_ *output, const Options &nopt)
 
template<typename Output_ = int, typename Value_ , typename Index_ >
std::vector< Output_ > by_row (const tatami::Matrix< Value_, Index_ > *p, const Options &nopt)
 
template<typename Output_ = int, typename Value_ , typename Index_ >
std::vector< Output_ > by_row (const tatami::Matrix< Value_, Index_ > *p)
 
template<typename Output_ = int, typename Value_ , typename Index_ >
std::vector< Output_ > by_column (const tatami::Matrix< Value_, Index_ > *p, const Options &nopt)
 
template<typename Output_ = int, typename Value_ , typename Index_ >
std::vector< Output_ > by_column (const tatami::Matrix< Value_, Index_ > *p)
 

Detailed Description

Functions for counting NaNs on each dimension.

Function Documentation

◆ apply()

template<typename Value_ , typename Index_ , typename Output_ >
void tatami_stats::counts::nan::apply ( bool  row,
const tatami::Matrix< Value_, Index_ > *  p,
Output_ *  output,
const Options nopt 
)
Template Parameters
Value_Type of the matrix value, should be summable.
Index_Type of the row/column indices.
Output_Type of the output value. This should be at least large enough to hold the dimensions of p.
Parameters
rowWhether to obtain a count for each row.
pPointer to a tatami::Matrix.
[out]outputPointer to an array of length equal to the number of rows. On output, this will store the number of NaNs in each row.
noptCounting options.

◆ by_row() [1/2]

template<typename Output_ = int, typename Value_ , typename Index_ >
std::vector< Output_ > tatami_stats::counts::nan::by_row ( const tatami::Matrix< Value_, Index_ > *  p,
const Options nopt 
)

Wrapper around apply() for row NaN counts.

Template Parameters
Output_Type of the output value.
Value_Type of the matrix value, should be summable.
Index_Type of the row/column indices.
Parameters
pPointer to a tatami::Matrix.
noptCounting options.
Returns
A vector of length equal to the number of rows, containing the number of NaNs in each row.

◆ by_row() [2/2]

template<typename Output_ = int, typename Value_ , typename Index_ >
std::vector< Output_ > tatami_stats::counts::nan::by_row ( const tatami::Matrix< Value_, Index_ > *  p)

Overload with default options.

Template Parameters
Output_Type of the output value.
Value_Type of the matrix value, should be summable.
Index_Type of the row/column indices.
Parameters
pPointer to a tatami::Matrix.
Returns
A vector of length equal to the number of rows, containing the number of NaNs in each row.

◆ by_column() [1/2]

template<typename Output_ = int, typename Value_ , typename Index_ >
std::vector< Output_ > tatami_stats::counts::nan::by_column ( const tatami::Matrix< Value_, Index_ > *  p,
const Options nopt 
)

Wrapper around apply() for column NaN counts.

Template Parameters
Output_Type of the output value. This should be at least large enough to hold the dimensions of p.
Value_Type of the matrix value, should be summable.
Index_Type of the row/column indices.
Parameters
pPointer to a tatami::Matrix.
noptCounting options.
Returns
A vector of length equal to the number of columns, containing the number of NaNs in each column.

◆ by_column() [2/2]

template<typename Output_ = int, typename Value_ , typename Index_ >
std::vector< Output_ > tatami_stats::counts::nan::by_column ( const tatami::Matrix< Value_, Index_ > *  p)

Overload with default options.

Template Parameters
Output_Type of the output value. This should be at least large enough to hold the dimensions of p.
Value_Type of the matrix value, should be summable.
Index_Type of the row/column indices.
Parameters
pPointer to a tatami::Matrix.
Returns
A vector of length equal to the number of columns, containing the number of NaNs in each column.