Tomographer
v5.4
Tomographer C++ Framework Documentation
|
The parameters of a Histogram. 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 | |
HistogramParams (Scalar min_=0.0, Scalar max_=1.0, Eigen::Index num_bins_=50) | |
The obvious constructor. | |
template<typename Params2 > | |
HistogramParams (const Params2 &other) | |
Copy constructor, from any other Histogram::Params type. | |
bool | isWithinBounds (Scalar value) const |
Tests whether the given value is in the range of the histogram. More... | |
Eigen::Index | binIndex (Scalar value) const |
Returns which bin this value should be counted in (index in the histogram's bins array) More... | |
Eigen::Index | binIndexUnsafe (Scalar value) const |
Returns which bin this value should be counted in. More... | |
Scalar | binLowerValue (Eigen::Index index) const |
Returns the value which a given bin index represents (lower bin value limit) More... | |
Scalar | binCenterValue (Eigen::Index index) const |
Returns the value which a given bin index represents (center bin value) More... | |
Scalar | binUpperValue (Eigen::Index 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. | |
Eigen::Index | num_bins |
Number of bins to split the range into. | |
The parameters of a Histogram.
This is the \([\text{min},\text{max}]\) range along with the number of bins.
Definition at line 72 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 157 of file histogram.h.
|
inline |
Returns which bin this value should be counted in (index in the histogram's bins array)
Definition at line 117 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 133 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 145 of file histogram.h.
|
inline |
Returns the width of a bin.
This is simply (max - min) / num_bins
.
Definition at line 179 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 170 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.