![]() |
Belle II Software release-09-00-03
|
Class which holds precomputed values of a function. More...
#include <LookupTable.h>

Public Member Functions | |
| LookupTable (const std::function< T(double)> &map, std::size_t nBins, double lowerBound, double upperBound) | |
| Constructs a look up table for the given function The function is sampled at nBins + 1 equally spaced points between the given bounds, such that the distance between consecutive sampling points is (upperBound - lowerBound) / nBins. | |
| T | operator() (double x) const |
| Evaluate as piecewise linear interpolation. | |
| const T & | nearest (double x) const |
| Return the precomputed value at the position closest to the given value. | |
| const T & | at (int i) const |
| Return the value at the given index. | |
| int | getNBins () const |
| Return the number of bins in this lookup table. | |
| int | getNPoints () const |
| Return the number of finite sampling points in this lookup table. | |
Private Attributes | |
| double | m_lowerBound |
| Lower bound of the precomputed range. | |
| double | m_upperBound |
| Upper bound of the precomputed range. | |
| double | m_binWidth |
| Distance between two precomputed positions. | |
| std::vector< T > | m_values |
| Precomputed value. | |
Class which holds precomputed values of a function.
Definition at line 50 of file LookupTable.h.
|
inline |
Constructs a look up table for the given function The function is sampled at nBins + 1 equally spaced points between the given bounds, such that the distance between consecutive sampling points is (upperBound - lowerBound) / nBins.
Definition at line 59 of file LookupTable.h.
|
inline |
Return the value at the given index.
Definition at line 94 of file LookupTable.h.
|
inline |
Return the number of bins in this lookup table.
Definition at line 102 of file LookupTable.h.
|
inline |
Return the number of finite sampling points in this lookup table.
Definition at line 108 of file LookupTable.h.
|
inline |
Return the precomputed value at the position closest to the given value.
Definition at line 84 of file LookupTable.h.
|
inline |
Evaluate as piecewise linear interpolation.
Definition at line 73 of file LookupTable.h.
|
private |
Distance between two precomputed positions.
Definition at line 121 of file LookupTable.h.
|
private |
Lower bound of the precomputed range.
Definition at line 115 of file LookupTable.h.
|
private |
Upper bound of the precomputed range.
Definition at line 118 of file LookupTable.h.
|
private |
Precomputed value.
Definition at line 124 of file LookupTable.h.