Belle II Software
release-08-01-10
|
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.