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

Calculate a single quantile for containers of variable length. More...

#include <parallel_quantiles.hpp>

Public Member Functions

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

Detailed Description

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

Calculate a single quantile for containers of variable length.

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 maximum number of elements and the desired probability. It can then be used to compute quantiles from containers of size less than or equal to the maximum. See SingleQuantile for more details.

Constructor & Destructor Documentation

◆ SingleQuantileVariable()

template<typename Output_ , class Iterator_ >
scran_blocks::SingleQuantileVariable< Output_, Iterator_ >::SingleQuantileVariable ( const std::size_t max_len,
const double quantile )
inline
Parameters
max_lenMaximum number of elements in the container. Unlike SingleQuantile, this may be zero.
quantileQuantile to compute, in $[0, 1]$.

Member Function Documentation

◆ operator()() [1/2]

template<typename Output_ , class Iterator_ >
Output_ scran_blocks::SingleQuantileVariable< Output_, Iterator_ >::operator() ( const std::size_t len,
Iterator_ begin,
Iterator_ end )
inline
Parameters
lenLength of the container. This should be equal to end - begin and no greater than max_len.
beginStart of the container.
endEnd of the container.
Returns
Quantile for the sequence of elements in [begin, end). If this sequence is empty, NaN is returned.

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

This method is not thread-safe.

◆ operator()() [2/2]

template<typename Output_ , class Iterator_ >
Output_ scran_blocks::SingleQuantileVariable< Output_, Iterator_ >::operator() ( Iterator_ begin,
Iterator_ end )
inline
Parameters
beginStart of the container.
endEnd of the container.
Returns
Quantile for the sequence of elements in [begin, end). If this sequence is empty, NaN is returned.

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

This method is not thread-safe.


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