![]() |
Elementa v8.0.0
Minimalistic library for any C++ application (C++11 and up)
|

Classes | |
| class | elementa::math::stats::Histogram |
| A one-dimensional histogram of data. More... | |
Constructors. | |
| template<class DIt > | |
| elementa::math::stats::Histogram::Histogram (const DIt &first, const DIt &pastend, const BinDef &bindef, const GetStaDatumFun< DIt > &getdatum=getstadatum_direct< DIt >) | |
| Fill the histogram with the data got by getdatum according to bindef. More... | |
| class elementa::math::stats::Histogram |
A one-dimensional histogram of data.
Definition at line 49 of file histograms.h.
Public Member Functions | |
Constructors. | |
| template<class DIt > | |
| Histogram (const DIt &first, const DIt &pastend, const BinDef &bindef, const GetStaDatumFun< DIt > &getdatum=getstadatum_direct< DIt >) | |
| Fill the histogram with the data got by getdatum according to bindef. More... | |
Methods. | |
| const BinDef & | bindef (void) const |
| Return a reference to the internal ref kept of the bin definition. More... | |
| size_t | numData (void) const noexcept |
| Return the number of data effectively used (within bins) for the hist. More... | |
| size_t | freq (size_t indbin) const |
| Return the frequency calculated for the INDBIN-th bin. More... | |
| std::string | to_string (void) const |
| Return a string with the information of the histogram. | |
|
inline |
Return a reference to the internal ref kept of the bin definition.
Definition at line 168 of file histograms.h.
Referenced by Histogram().
|
inlinenoexcept |
Return the number of data effectively used (within bins) for the hist.
Definition at line 171 of file histograms.h.
|
inline |
Return the frequency calculated for the INDBIN-th bin.
If that bin is out of range, throw.
| indbin | is an index defined like in BinDef::binBounds(). |
Definition at line 176 of file histograms.h.
References ELE_CODE_OUTOFRANGE.
| elementa::math::stats::Histogram::Histogram | ( | const DIt & | first, |
| const DIt & | pastend, | ||
| const BinDef & | bindef, | ||
| const GetStaDatumFun< DIt > & | getdatum = getstadatum_direct<DIt> |
||
| ) |
#include <elementa/math/stats/histograms.h>
Fill the histogram with the data got by getdatum according to bindef.
The data is collected from the range [first,pastend). BINDEF must outlive this object, since an internal reference to it is kept (no ownership).
Definition at line 208 of file histograms.h.
References elementa::math::stats::Histogram::bindef(), ELE_CODE_INVARG, elementa::math::stats::Histogram::BinDef::entireReals(), elementa::math::stats::Histogram::BinDef::numbins(), and elementa::math::stats::Histogram::BinDef::whichBin().