Elementa v8.0.0
Minimalistic library for any C++ application (C++11 and up)
Loading...
Searching...
No Matches

Description


Author
Juan-Antonio Fernandez-Madrigal. http://jafma.net
Date
2019
Collaboration diagram for histograms:

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 Documentation

◆ elementa::math::stats::Histogram

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 BinDefbindef (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.
 

Member Function Documentation

◆ bindef()

const BinDef & elementa::math::stats::Histogram::bindef ( void  ) const
inline

Return a reference to the internal ref kept of the bin definition.

Definition at line 168 of file histograms.h.

Referenced by Histogram().

◆ numData()

size_t elementa::math::stats::Histogram::numData ( void  ) const
inlinenoexcept

Return the number of data effectively used (within bins) for the hist.

Definition at line 171 of file histograms.h.

◆ freq()

size_t elementa::math::stats::Histogram::freq ( size_t  indbin) const
inline

Return the frequency calculated for the INDBIN-th bin.

If that bin is out of range, throw.

Parameters
indbinis an index defined like in BinDef::binBounds().

Definition at line 176 of file histograms.h.

References ELE_CODE_OUTOFRANGE.

Function Documentation

◆ Histogram()

template<class DIt >
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().