25 #ifndef _FUNCTIONUTILS_CUMULATIVE_H 26 #define _FUNCTIONUTILS_CUMULATIVE_H TrayPosition
when looking for the position having a given value, one may encounter tray where the value is constan...
std::vector< double > m_x_sampling
Class for build cumulative from PDF and extract feature out of it.
static Cumulative fromPdf(std::vector< double > &x_sampling, std::vector< double > &pdf_sampling)
Factory from the sampling of a PDF. The Cumulative vertical samples are build as the sum of the the p...
std::vector< double > m_y_sampling
Cumulative & operator=(Cumulative &&other)
move assignation operator
void normalize()
Normalize the Cumulative. After calling this function the last vertical value is 1....
double findValue(double ratio, TrayPosition position=TrayPosition::middle) const
Find the first horizontal sample which vertical value is bigger or equal to the ratio value....
std::pair< double, double > findMinInterval(double rate) const
Scan the horizontal axis looking for the smallest x-interval for which the vertical interval is at le...
std::pair< double, double > findCenteredInterval(double rate) const
return the horizontal interval starting where the Cumulative has value (1-ratio)/2 and ending where t...
Cumulative(Cumulative &&other)
move constructor
This module provides an interface for accessing two dimensional datasets (pairs of (X,...
virtual ~Cumulative()=default
Destructor.