tatami_stats
Matrix statistics for tatami
|
Functions for computing dimension-wise counts. More...
Namespaces | |
namespace | nan |
Functions for counting NaNs on each dimension. | |
namespace | zero |
Functions for counting zeros on each dimension. | |
Functions | |
template<typename Value_ , typename Index_ , typename Output_ , class Condition_ > | |
void | apply (bool row, const tatami::Matrix< Value_, Index_ > *p, Output_ *output, int num_threads, Condition_ condition) |
Functions for computing dimension-wise counts.
void tatami_stats::counts::apply | ( | bool | row, |
const tatami::Matrix< Value_, Index_ > * | p, | ||
Output_ * | output, | ||
int | num_threads, | ||
Condition_ | condition | ||
) |
Count the number of values that satisfy the condition
in each element of a chosen dimension.
Value_ | Type of the matrix value, should be numeric. |
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 . |
row | Whether to perform the count within each row. If false, the count is performed within each column instead. | |
p | Pointer to a tatami::Matrix . | |
[out] | output | Pointer to an array of length equal to the number of rows (if row = true ) or columns (otherwise). On output, this will contain the row/column variances. |
num_threads | Number of threads to use, for parallelization via tatami::parallelize() . | |
condition | Function that accepts a Value_ and returns a boolean. This function is also responsible for handling any NaNs that might be present in p . |