41 while (iter !=
pdf.
end()) {
42 xs.push_back((*iter).first);
43 ys.push_back((*iter).second);
74 if (position == 0 ||
pdf[position] == 0) {
85 if (position ==
pdf.
size() - 1 ||
pdf[position] == 0) {
104 for (
size_t index =
min_x; index <=
max_x; ++index) {
107 dx = (
pdf.first[index + 1] -
pdf.first[index])/2.0;
108 }
else if (index ==
pdf.first.
size() - 1) {
109 dx = (
pdf.first[index] -
pdf.first[index - 1])/2.0;
111 dx = (
pdf.first[index + 1] -
pdf.first[index - 1]) / 2.0;
170 for (
size_t index =
min_x; index <=
max_x; ++index) {
218 if ((*iter_mode).getModeArea() <
mean_area.second) {
Class for storing the information of a PDF mode.
This module provides an interface for accessing two dimensional datasets (pairs of (X,...
size_t findMaximumIndex(const std::vector< double > &pdf)
std::pair< std::vector< double >, std::vector< double > > flatternPeak(const std::pair< std::vector< double >, std::vector< double > > &pdf, size_t min_x, size_t max_x, double value)
std::pair< std::vector< double >, std::vector< double > > getXYs(const XYDataset::XYDataset &pdf)
std::pair< size_t, size_t > catchPeak(const std::vector< double > &pdf, size_t center_index, double merge_ratio)
double getInterpolationAround(const std::pair< std::vector< double >, std::vector< double > > &pdf, size_t x_index)
std::array< std::vector< double >, N > Coordinates
Used to pass the grid coordinates to interpn. Internally will make a copy of the required values.
std::pair< double, double > avgArea(std::pair< std::vector< double >, std::vector< double > > &pdf, size_t min_x, size_t max_x)
std::vector< ModeInfo > extractNBigestModes(const XYDataset::XYDataset &pdf, double merge_ratio, size_t n)
std::vector< ModeInfo > extractNHighestModes(const XYDataset::XYDataset &pdf, double merge_ratio, size_t n)