Tomographer
v4.0
Tomographer C++ Framework Documentation
|
The parameters of a UniformBinsHistogram. More...
#include <tomographer/histogram.h>
Public Types | |
typedef Scalar_ | Scalar |
The scalar type used to specify the "value" (horizongal axis) of the histogram. | |
Public Member Functions | |
UniformBinsHistogramParams (Scalar min_=0.0, Scalar max_=1.0, std::size_t num_bins_=50) | |
The obvious constructor. | |
template<typename Params2 , decltype((int) std::declval< const Params2 >().min+(int) std::declval< const Params2 >().max+std::declval< Params2 >().num_bins) dummyval = 0> | |
UniformBinsHistogramParams (const Params2 &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 the histogram's 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... | |
Eigen::Array< Scalar, Eigen::Dynamic, 1 > | valuesCenter () const |
Return an array of values corresponding to the center of each bin. | |
Eigen::Array< Scalar, Eigen::Dynamic, 1 > | valuesLower () const |
Return an array of values corresponding to the lower value of each bin. | |
Eigen::Array< Scalar, Eigen::Dynamic, 1 > | valuesUpper () const |
Return an array of values corresponding to the upper value of each bin. | |
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 along with the number of bins.
Definition at line 68 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 150 of file histogram.h.
|
inline |
Returns which bin this value should be counted in (index in the histogram's bins array)
Definition at line 110 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 126 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 138 of file histogram.h.
|
inline |
Returns the width of a bin.
This is simply (max - min) / num_bins
.
Definition at line 172 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 163 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 100 of file histogram.h.