OpenMPCD
|
Represents a histogram. More...
#include <Histogram.hpp>
Public Types | |
typedef unsigned long | BinContent |
The type of bin contents. More... | |
typedef std::vector< BinContent > | Container |
The container for bins. More... | |
Public Member Functions | |
Histogram (const std::string &name, const Configuration &conf) | |
The constructor. More... | |
Histogram (const FP low, const FP high, const unsigned int binCount) | |
The constructor. More... | |
void | fill (const FP val) |
Adds an entry to the histogram. More... | |
BinContent | getUnderflows () const |
Returns the number of underflows. More... | |
BinContent | getOverflows () const |
Returns the number of overflows. More... | |
const Container & | getBins () const |
Returns the bins. More... | |
FP | getLowEnd () const |
Returns the lower end of the histogram. More... | |
FP | getHighEnd () const |
Returns the upper end of the histogram. More... | |
FP | getBinSize () const |
Returns the bin size. More... | |
FP | getIntegral () const |
Returns the integral of the histogram. More... | |
const Graph | getNormalizedGraph (const FP binPoint=0.5) const |
Returns the graph corresponding to this histogram, with the area normalized to 1. More... | |
void | save (const std::string &filename, const FP binPoint=0.5) const |
Saves the histogram at the given path. More... | |
Represents a histogram.
Definition at line 20 of file Histogram.hpp.
typedef unsigned long OpenMPCD::Histogram::BinContent |
The type of bin contents.
Definition at line 23 of file Histogram.hpp.
typedef std::vector<BinContent> OpenMPCD::Histogram::Container |
The container for bins.
Definition at line 24 of file Histogram.hpp.
OpenMPCD::Histogram::Histogram | ( | const std::string & | name, |
const Configuration & | conf | ||
) |
The constructor.
[in] | name | The histogram name. |
[in] | conf | The simulation configuration. |
Definition at line 9 of file Histogram.cpp.
The constructor.
[in] | low | The lowest bin's lower end. |
[in] | high | The highest bin's highest end. |
[in] | binCount | The number of bins. |
Definition at line 40 of file Histogram.hpp.
void OpenMPCD::Histogram::fill | ( | const FP | val | ) |
Adds an entry to the histogram.
[in] | val | The value to add. |
Definition at line 21 of file Histogram.cpp.
|
inline |
Returns the bins.
Definition at line 71 of file Histogram.hpp.
|
inline |
Returns the bin size.
Definition at line 95 of file Histogram.hpp.
|
inline |
Returns the upper end of the histogram.
Definition at line 87 of file Histogram.hpp.
OpenMPCD::FP OpenMPCD::Histogram::getIntegral | ( | ) | const |
Returns the integral of the histogram.
Definition at line 45 of file Histogram.cpp.
|
inline |
Returns the lower end of the histogram.
Definition at line 79 of file Histogram.hpp.
const OpenMPCD::Graph OpenMPCD::Histogram::getNormalizedGraph | ( | const FP | binPoint = 0.5 | ) | const |
Returns the graph corresponding to this histogram, with the area normalized to 1.
[in] | binPoint | Since the bin has a non-zero width and the graph only consists of points, this parameter can be used to control where the graph point corresponding to a bin is situated. 0 means the point is at the leftmost end of the bin, 1 corresponds to the rightmost end, and the values inbetween scale linearly. |
InvalidArgumentException | Throws if binPoint is not in the range [0,1]. |
Definition at line 55 of file Histogram.cpp.
|
inline |
Returns the number of overflows.
Definition at line 63 of file Histogram.hpp.
|
inline |
Returns the number of underflows.
Definition at line 55 of file Histogram.hpp.
void OpenMPCD::Histogram::save | ( | const std::string & | filename, |
const FP | binPoint = 0.5 |
||
) | const |
Saves the histogram at the given path.
[in] | filename | The filename to save to. |
[in] | binPoint | Since the bin has a non-zero width and the graph only consists of points, this parameter can be used to control where the graph point corresponding to a bin is situated. 0 means the point is at the leftmost end of the bin, 1 corresponds to the rightmost end, and the values inbetween scale linearly. |
InvalidArgumentException | Throws if binPoint is not in the range [0,1]. |
Definition at line 75 of file Histogram.cpp.