Tomographer
v2.0
Tomographer C++ Framework Documentation
|
The parameters of a UniformBinsHistogram. More...
#include <tomographer2/histogram.h>
Public Member Functions | |
Params (Scalar min_=0.0, Scalar max_=1.0, std::size_t num_bins_=50) | |
The obvious constructor. | |
template<typename OtherParams > | |
Params (const OtherParams &other) | |
Copy constructor, from any other UniformBinsHistogram::Params type. | |
bool | isWithinBounds (Scalar value) const |
Tests whether the given value is in the range of the histogram. More... | |
std::size_t | binIndex (Scalar value) const |
Returns which bin this value should be counted in (index in bins array) More... | |
std::size_t | binIndexUnsafe (Scalar value) const |
Returns which bin this value should be counted in. More... | |
Scalar | binLowerValue (std::size_t index) const |
Returns the value which a given bin index represents (lower bin value limit) More... | |
Scalar | binCenterValue (std::size_t index) const |
Returns the value which a given bin index represents (center bin value) More... | |
Scalar | binUpperValue (std::size_t index) const |
Returns the value which a given bin index represents (upper bin value limit) More... | |
Scalar | binResolution () const |
Returns the width of a bin. More... | |
Public Attributes | |
Scalar | min |
Lower range value. | |
Scalar | max |
Upper range value. | |
std::size_t | num_bins |
Number of bins to split the range into. | |
The parameters of a UniformBinsHistogram.
This is the \([\text{min},\text{max}]\) range and the number of bins.
Definition at line 87 of file histogram.h.
|
inline |
Returns the value which a given bin index represents (center bin value)
This is the value at the center of the bin.
index >= 0 && index < num_bins
, or you might get an assert()
failure in your face. Definition at line 163 of file histogram.h.
|
inline |
Returns which bin this value should be counted in (index in bins array)
Definition at line 123 of file histogram.h.
|
inline |
Returns which bin this value should be counted in.
This function blindly assumes its argument is within bounds, i.e. it must satisfy isWithinBounds(value)
.
Use this function only if you're sure the value is within bounds, otherwise call binIndex().
Definition at line 139 of file histogram.h.
|
inline |
Returns the value which a given bin index represents (lower bin value limit)
This is the value at the left edge of the bin.
index >= 0 && index < num_bins
, or you might get an assert()
failure in your face. Definition at line 151 of file histogram.h.
|
inline |
Returns the width of a bin.
This is simply (max - min) / num_bins
.
Definition at line 185 of file histogram.h.
|
inline |
Returns the value which a given bin index represents (upper bin value limit)
This is the value at the right edge of the bin.
index >= 0 && index < num_bins
, or you might get an assert()
failure in your face. Definition at line 176 of file histogram.h.
|
inline |
Tests whether the given value is in the range of the histogram.
true
if value
is finite (not inf or nan) and within the interval \([\text{min},\text{max}[\). Definition at line 114 of file histogram.h.