Tomographer
v1.0a
Tomographer C++ Framework Documentation
|
The parameters of a UniformBinsHistogram. More...
#include <tomographer/histogram.h>
Public Member Functions | |
Params (Scalar min_=0.0, Scalar max_=1.0, std::size_t num_bins_=50) | |
obvious constructor | |
template<typename OtherParams > | |
Params (const OtherParams &other) | |
Copy constructor, from any other UniformBinsHistogram::Params type. | |
bool | is_within_bounds (Scalar value) const |
Tests whether the given value is in the range of the histogram. More... | |
std::size_t | bin_index (Scalar value) const |
Returns which bin this value should be counted in (index in bins array) More... | |
std::size_t | bin_index_unsafe (Scalar value) const |
Returns which bin this value should be counted in. More... | |
Scalar | bin_lower_value (std::size_t index) const |
Returns the value which a given bin index represents (lower bin value limit) More... | |
Scalar | bin_center_value (std::size_t index) const |
Returns the value which a given bin index represents (center bin value) More... | |
Scalar | bin_upper_value (std::size_t index) const |
Returns the value which a given bin index represents (upper bin value limit) More... | |
Scalar | bin_resolution () 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 80 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 156 of file histogram.h.
|
inline |
Returns which bin this value should be counted in (index in bins array)
Definition at line 116 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 is_within_bounds(value)
.
Use this function only if you're sure the value is within bounds, otherwise call bin_index().
Definition at line 132 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 144 of file histogram.h.
|
inline |
Returns the width of a bin.
This is simply (max - min) / num_bins
.
Definition at line 178 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 169 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 107 of file histogram.h.