tatami_stats
Matrix statistics for tatami
|
Functions for computing dimension-wise ranges. More...
Classes | |
struct | Options |
Range calculation options. More... | |
class | RunningDense |
Running minima/maxima from dense data. More... | |
class | RunningSparse |
Running minima/maxima from sparse data. More... | |
Functions | |
template<bool minimum_, typename Value_ , typename Index_ > | |
Value_ | direct (const Value_ *ptr, Index_ num, bool skip_nan) |
template<bool minimum_, typename Value_ , typename Index_ > | |
Value_ | direct (const Value_ *value, Index_ num_nonzero, Index_ num_all, bool skip_nan) |
template<typename Value_ , typename Index_ , typename Output_ > | |
void | apply (bool row, const tatami::Matrix< Value_, Index_ > *p, Output_ *min_out, Output_ *max_out, const Options &ropt) |
template<typename Output_ = double, typename Value_ , typename Index_ > | |
std::pair< std::vector< Output_ >, std::vector< Output_ > > | by_column (const tatami::Matrix< Value_, Index_ > *p, const Options &ropt) |
template<typename Output_ = double, typename Value_ , typename Index_ > | |
std::pair< std::vector< Output_ >, std::vector< Output_ > > | by_column (const tatami::Matrix< Value_, Index_ > *p) |
template<typename Output_ = double, typename Value_ , typename Index_ > | |
std::pair< std::vector< Output_ >, std::vector< Output_ > > | by_row (const tatami::Matrix< Value_, Index_ > *p, const Options &ropt) |
template<typename Output_ = double, typename Value_ , typename Index_ > | |
std::pair< std::vector< Output_ >, std::vector< Output_ > > | by_row (const tatami::Matrix< Value_, Index_ > *p) |
Functions for computing dimension-wise ranges.
Value_ tatami_stats::ranges::direct | ( | const Value_ * | ptr, |
Index_ | num, | ||
bool | skip_nan | ||
) |
Directly compute the minimum or maximum of a dense objective vector.
minimum_ | Whether to compute the minimum. If false, the maximum is computed instead. |
Value_ | Type of the input data. |
Index_ | Type of the row/column indices. |
[in] | ptr | Pointer to an array of length num , containing the values of the objective vector. |
num | Length of the objective vector, i.e., length of the array at ptr . | |
skip_nan | See Options::skip_nan for details. |
minimum_
. If num = 0
or (if skip_nan_ = true
) there are no non-NaN values, a placeholder value is returned instead that is never less than (if minimum_ true
) or greater than (otherwise) any non-NaN value of type Value_
. Value_ tatami_stats::ranges::direct | ( | const Value_ * | value, |
Index_ | num_nonzero, | ||
Index_ | num_all, | ||
bool | skip_nan | ||
) |
Compute the extremes of a sparse objective vector.
minimum_ | Whether to compute the minimum. If false, the maximum is computed instead. |
Value_ | Type of the input data. |
Index_ | Type of the row/column indices. |
[in] | value | Pointer to an array of length num_nonzero , containing the values of the structural non-zeros. |
num_nonzero | Number of structural non-zeros in the objective vector. | |
num_all | Length of the objective vector, including the structural zeros not in value . This should be greater than or equal to num_nonzero . | |
skip_nan | See Options::skip_nan for details. |
minimum_
. If num_all = 0
or (if skip_nan_ = true
) there are no non-NaN values, a placeholder value is returned instead that is never less than (if minimum_ true
) or greater than (otherwise) any non-NaN value of type Value_
. void tatami_stats::ranges::apply | ( | bool | row, |
const tatami::Matrix< Value_, Index_ > * | p, | ||
Output_ * | min_out, | ||
Output_ * | max_out, | ||
const Options & | ropt | ||
) |
Compute ranges for each element of a chosen dimension of a tatami::Matrix
.
Value_ | Type of the matrix value, should be numeric. |
Index_ | Type of the row/column indices. |
Output_ | Type of the output value. |
row | Whether to compute the range for each row. If false, the range is computed for each column instead. | |
p | Pointer to a tatami::Matrix . | |
[out] | min_out | Pointer to an array of length equal to the number of rows (if row = true ) or columns (otherwise). On output, this will contain the minimum of each row/column. Alternatively, this may be NULL, in which case the minima are not computed. |
[out] | max_out | Pointer to an array of length equal to the number of rows (if row = true ) or columns (otherwise). On output, this will contain the maximum of each row/column. Alternatively, this may be NULL, in which case the maxima are not computed. |
ropt | Range calculation options. |
std::pair< std::vector< Output_ >, std::vector< Output_ > > tatami_stats::ranges::by_column | ( | const tatami::Matrix< Value_, Index_ > * | p, |
const Options & | ropt | ||
) |
Wrapper around apply()
for column ranges.
Output | Type of the output value. |
Value_ | Type of the matrix value. |
Index_ | Type of the row/column indices. |
p | Pointer to a tatami::Matrix . |
ropt | Range calculation options. |
std::pair< std::vector< Output_ >, std::vector< Output_ > > tatami_stats::ranges::by_column | ( | const tatami::Matrix< Value_, Index_ > * | p | ) |
Overload with default options.
Output | Type of the output value. |
Value_ | Type of the matrix value. |
Index_ | Type of the row/column indices. |
p | Pointer to a tatami::Matrix . |
std::pair< std::vector< Output_ >, std::vector< Output_ > > tatami_stats::ranges::by_row | ( | const tatami::Matrix< Value_, Index_ > * | p, |
const Options & | ropt | ||
) |
Wrapper around apply()
for row ranges.
Output | Type of the output value. |
Value_ | Type of the matrix value. |
Index_ | Type of the row/column indices. |
p | Pointer to a tatami::Matrix . |
ropt | Range calculation options. |
std::pair< std::vector< Output_ >, std::vector< Output_ > > tatami_stats::ranges::by_row | ( | const tatami::Matrix< Value_, Index_ > * | p | ) |
Overload with default options.
Output | Type of the output value. |
Value_ | Type of the matrix value. |
Index_ | Type of the row/column indices. |
p | Pointer to a tatami::Matrix . |