#include <Binning.h>
Public Member Functions | |
| Binning (int nbins, double minval, double maxval) | |
| Binning () | |
| void | set (int nbins, double minval, double maxval) |
| int | nbins () const |
| double | min () const |
| double | max () const |
| double | span () const |
| Return the max-min. More... | |
| std::pair< double, double > | range () const |
| std::pair< int, int > | irange () const |
| double | binsize () const |
| int | bin (double val) const |
| double | center (int ind) const |
| int | edge_index (double val) const |
| double | edge (int ind) const |
| bool | inside (double val) const |
| bool | inbounds (int bin) const |
| Return true if bin is in bounds. More... | |
| std::pair< int, int > | sample_bin_range (double minval, double maxval) const |
Private Attributes | |
| int | m_nbins |
| double | m_minval |
| double | m_maxval |
| double | m_binsize |
A binning is a uniform discretization of a linear space.
This class largely provides methods that give semantic labels to various calculations related to a binned region.
|
inline |
|
inline |
Return the bin containing value. If val is in range, return value is [0,nbins-1] but no range checking is performed.
Definition at line 80 of file Binning.h.
|
inline |
|
inline |
|
inline |
|
inline |
Return the edge, nominally in [0,nbins] closest to the given value. Range checking is not done so returned edge may be outside of range.
Definition at line 93 of file Binning.h.
|
inline |
|
inline |
Return true value is in range. Range is considered half open. Ig, edge(nbins) is not inside range.
Definition at line 105 of file Binning.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Return half-open bin range which covers the range of values. Bounds are forced to return values in [0,nbins].
Definition at line 116 of file Binning.h.
|
inline |
|
inline |
1.8.11