Alexandria 2.31.0
SDC-CH common library for the Euclid project
Loading...
Searching...
No Matches
PdfModeExtraction.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2012-2021 Euclid Science Ground Segment
3 *
4 * This library is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU Lesser General Public License as published by the Free
6 * Software Foundation; either version 3.0 of the License, or (at your option)
7 * any later version.
8 *
9 * This library is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12 * details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this library; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
25#ifndef _MATHUTILS_PDF_PDFMODEEXTRACTION_H
26#define _MATHUTILS_PDF_PDFMODEEXTRACTION_H
27
28#include "XYDataset/XYDataset.h"
29#include <cstddef>
30#include <tuple>
31#include <utility>
32#include <vector>
33
34namespace Euclid {
35namespace MathUtils {
46class ModeInfo {
47public:
48 ModeInfo(double highest_sample, double mean, double interpolated, double area)
50
51 double getHighestSamplePosition() const {
52 return m_sample;
53 }
54
55 double getMeanPosition() const {
56 return m_mean;
57 }
58
60 return m_interp;
61 }
62
63 double getModeArea() const {
64 return m_area;
65 }
66
67private:
68 double m_sample;
69 double m_mean;
70 double m_interp;
71 double m_area;
72};
73
90
108 double merge_ratio, size_t n);
109
126
144 double merge_ratio, size_t n);
145
146} /* namespace MathUtils */
147} // namespace Euclid
148
149#endif
Class for storing the information of a PDF mode.
ModeInfo(double highest_sample, double mean, double interpolated, double area)
double getInterpolatedMaxPosition() const
double getHighestSamplePosition() const
This module provides an interface for accessing two dimensional datasets (pairs of (X,...
Definition XYDataset.h:59
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)