GENIEGenerator
|
A class template that performs bilinear interpolation on a non-uniform grid with an implementation similar to that of genie::BLI2DNonUnifGrid. More...
#include <BLI2DNonUnifObjectGrid.h>
Public Member Functions | |
BLI2DNonUnifObjectGrid (const std::vector< XType > *X, const std::vector< YType > *Y, const std::vector< ZObject > *Z, bool extrapolate=false) | |
XType | x_min () const |
Retrieve the minimum x value. More... | |
XType | x_max () const |
Retrieve the maximum x value. More... | |
YType | y_min () const |
Retrieve the minimum y value. More... | |
YType | y_max () const |
Retrieve the maximum y value. More... | |
IndexType | index_Z (IndexType ix, IndexType iy) const |
ZObject | interpolate (double x, double y) const |
Protected Member Functions | |
template<typename Type > | |
bool | get_bound_indices (const std::vector< Type > *vec, Type val, int &lower_index, int &upper_index) const |
Protected Attributes | |
const std::vector< XType > * | fX |
Pointer to the vector of x coordinates. More... | |
const std::vector< YType > * | fY |
Pointer to the vector of y coordinates. More... | |
const std::vector< ZObject > * | fZ |
Pointer to the vector of z coordinate objects. More... | |
bool | fExtrapolate |
A class template that performs bilinear interpolation on a non-uniform grid with an implementation similar to that of genie::BLI2DNonUnifGrid.
The main differences between this class template and genie::BLI2DNonUnifGrid are
Values for the z coordinate can be any arbitrary object Object that implements the member functions operator*(double), operator*(const Object&), and operator+(const Object&) Rather than C-style arrays, the grid values are accessed via pointers to std::vector objects Upper and lower bounds on the grid are found using std::lower_bound() rather than a manual linear search The genie::BLI2DNonUnifGrid object does not take ownership of the grid vectors, which must be stored elsewhere
ZObject | Type of the object describing each z coordinate |
IndexType | Type to use when computing indices in the vectors |
XType | Type used to represent x coordinates |
YType | Type used to represent y coordinates |
Definition at line 49 of file BLI2DNonUnifObjectGrid.h.
|
inline |
[in] | X | Pointer to a vector of x coordinates |
[in] | Y | Pointer to a vector of y coordinates |
[in] | Z | Pointer to a vector of z coordinates |
[in] | extrapolate | Whether to allow bilinear extrapolation (true) or to use the grid endpoints (false) when evaluating z values outside of the grid |
Definition at line 59 of file BLI2DNonUnifObjectGrid.h.
|
inlineprotected |
Determines the indices for the two gridpoints surrounding a requested x or y coordinate. If the x or y coordinate is outside of the grid, this function returns the two closest grid points.
[in] | vec | A vector of grid point coordinates |
[in] | val | The requested x or y coordinate |
[out] | lower_index | The index of the closest grid point less than or equal to the requested value, or the lower of the two nearest grid points if the value falls outside of the grid |
[out] | upper_index | The index of the closest grid point greater than the requested value, or the higher of the two nearest grid points if the value falls outside of the grid |
Definition at line 161 of file BLI2DNonUnifObjectGrid.h.
Referenced by genie::BLI2DNonUnifObjectGrid< genie::TabulatedLabFrameHadronTensor::TableEntry >::interpolate().
|
inline |
Calculates the index in the vector of z coordinates that corresponds to a given set of x and y indices
[in] | ix | Index of the desired grid point on the x axis |
[in] | iy | Index of the desired grid point on the y axis |
Definition at line 80 of file BLI2DNonUnifObjectGrid.h.
Referenced by genie::BLI2DNonUnifObjectGrid< genie::TabulatedLabFrameHadronTensor::TableEntry >::interpolate().
|
inline |
Uses bilinear interpolation to compute the z coordinate (represented by an object of type ZObject) that corresponds to the given x and y coordinates
Definition at line 89 of file BLI2DNonUnifObjectGrid.h.
|
inline |
Retrieve the maximum x value.
Definition at line 68 of file BLI2DNonUnifObjectGrid.h.
Referenced by genie::BLI2DNonUnifObjectGrid< genie::TabulatedLabFrameHadronTensor::TableEntry >::interpolate().
|
inline |
Retrieve the minimum x value.
Definition at line 65 of file BLI2DNonUnifObjectGrid.h.
Referenced by genie::BLI2DNonUnifObjectGrid< genie::TabulatedLabFrameHadronTensor::TableEntry >::interpolate().
|
inline |
Retrieve the maximum y value.
Definition at line 74 of file BLI2DNonUnifObjectGrid.h.
Referenced by genie::BLI2DNonUnifObjectGrid< genie::TabulatedLabFrameHadronTensor::TableEntry >::interpolate().
|
inline |
Retrieve the minimum y value.
Definition at line 71 of file BLI2DNonUnifObjectGrid.h.
Referenced by genie::BLI2DNonUnifObjectGrid< genie::TabulatedLabFrameHadronTensor::TableEntry >::interpolate().
|
protected |
Whether to allow bilinear extrapolation (true) or to compute z values for x and coordinates outside of the grid using the grid endpoints (false)
Definition at line 146 of file BLI2DNonUnifObjectGrid.h.
Referenced by genie::BLI2DNonUnifObjectGrid< genie::TabulatedLabFrameHadronTensor::TableEntry >::interpolate().
|
protected |
Pointer to the vector of x coordinates.
Definition at line 138 of file BLI2DNonUnifObjectGrid.h.
Referenced by genie::BLI2DNonUnifObjectGrid< genie::TabulatedLabFrameHadronTensor::TableEntry >::interpolate(), genie::BLI2DNonUnifObjectGrid< genie::TabulatedLabFrameHadronTensor::TableEntry >::x_max(), and genie::BLI2DNonUnifObjectGrid< genie::TabulatedLabFrameHadronTensor::TableEntry >::x_min().
|
protected |
Pointer to the vector of y coordinates.
Definition at line 139 of file BLI2DNonUnifObjectGrid.h.
Referenced by genie::BLI2DNonUnifObjectGrid< genie::TabulatedLabFrameHadronTensor::TableEntry >::index_Z(), genie::BLI2DNonUnifObjectGrid< genie::TabulatedLabFrameHadronTensor::TableEntry >::interpolate(), genie::BLI2DNonUnifObjectGrid< genie::TabulatedLabFrameHadronTensor::TableEntry >::y_max(), and genie::BLI2DNonUnifObjectGrid< genie::TabulatedLabFrameHadronTensor::TableEntry >::y_min().
|
protected |
Pointer to the vector of z coordinate objects.
Definition at line 142 of file BLI2DNonUnifObjectGrid.h.
Referenced by genie::BLI2DNonUnifObjectGrid< genie::TabulatedLabFrameHadronTensor::TableEntry >::interpolate().