scran_blocks
Blocking utilities for libscran
Loading...
Searching...
No Matches
scran_blocks::SingleQuantile< Output_, Iterator_ > Class Template Reference

Calculate a single quantile from a container. More...

#include <parallel_quantiles.hpp>

Public Member Functions

 SingleQuantile (const std::size_t len, const double quantile)
 
Output_ operator() (Iterator_ begin, Iterator_ end) const
 

Detailed Description

template<typename Output_, class Iterator_>
class scran_blocks::SingleQuantile< Output_, Iterator_ >

Calculate a single quantile from a container.

Template Parameters
Output_Floating-point type of the output quantile.
Iterator_Random-access writeable iterator to a container.

This class should be constructed once, given the number of elements and the desired probability. It can then be used to compute a quantile for containers of size equal to the pre-specified number of elements. The quantile is type 7, consistent with the default in R's quantile function.

Constructor & Destructor Documentation

◆ SingleQuantile()

template<typename Output_ , class Iterator_ >
scran_blocks::SingleQuantile< Output_, Iterator_ >::SingleQuantile ( const std::size_t len,
const double quantile )
inline
Parameters
lenNumber of elements in the container, should be positive.
quantileQuantile to compute, in $[0, 1]$.

Member Function Documentation

◆ operator()()

template<typename Output_ , class Iterator_ >
Output_ scran_blocks::SingleQuantile< Output_, Iterator_ >::operator() ( Iterator_ begin,
Iterator_ end ) const
inline
Parameters
beginStart of the container.
endEnd of the container.
Returns
Quantile for the sequence of elements in [begin, end).

The range [begin, end) should have length equal to n, and should not contain any NaN values. On output, the order of elements in [begin, end) may be rearranged.


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