LHAPDF  6.5.6
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
LHAPDF::Interpolator Class Referenceabstract

The general interface for interpolating between grid points. More...

#include <Interpolator.h>

Inheritance diagram for LHAPDF::Interpolator:
LHAPDF::BicubicInterpolator LHAPDF::BilinearInterpolator LHAPDF::LogBicubicInterpolator LHAPDF::LogBilinearInterpolator

Public Member Functions

virtual ~Interpolator ()
 Destructor to allow inheritance.
 
std::string type () const
 
void setType (std::string t)
 Set the interpolation type.
 
Binding to a PDF object
void bind (const GridPDF *pdf)
 Bind to a GridPDF.
 
void unbind ()
 Unbind from GridPDF.
 
bool hasPDF ()
 Identify whether this Interpolator has an associated PDF.
 
const GridPDF & pdf () const
 Get the associated GridPDF.
 
Interpolation methods
double interpolateXQ (int id, double x, double q) const
 Interpolate a single-point in (x,Q)
 
double interpolateXQ2 (int id, double x, double q2) const
 Interpolate a single-point in (x,Q2)
 
void interpolateXQ2 (double x, double q2, std::vector< double > &ret) const
 

Protected Member Functions

virtual double _interpolateXQ2 (const KnotArray &grid, double x, size_t ix, double q2, size_t iq2, int id) const =0
 Interpolate a single-point in (x,Q2), given x/Q2 values and subgrid indices. More...
 
virtual void _interpolateXQ2 (const KnotArray &grid, double x, size_t ix, double q2, size_t iq2, std::vector< double > &ret) const
 Interpolate a single-point in (x,Q2), given x/Q2 values and subgrid indices, for all 11 standard flavours at once. More...
 

Private Attributes

const GridPDF * _pdf
 
std::string _type
 

Detailed Description

The general interface for interpolating between grid points.

Member Function Documentation

◆ _interpolateXQ2() [1/2]

virtual double LHAPDF::Interpolator::_interpolateXQ2 ( const KnotArray &  grid,
double  x,
size_t  ix,
double  q2,
size_t  iq2,
int  id 
) const
protectedpure virtual

Interpolate a single-point in (x,Q2), given x/Q2 values and subgrid indices.

The key function to be overridden in derived classes: the subgrid and x/Q2 index lookup (and their caching) are done centrally in the Interpolator base class so do not need to be re-implemented in each flavour of interpolator.

Implemented in LHAPDF::LogBicubicInterpolator, LHAPDF::BicubicInterpolator, LHAPDF::BilinearInterpolator, and LHAPDF::LogBilinearInterpolator.

◆ _interpolateXQ2() [2/2]

virtual void LHAPDF::Interpolator::_interpolateXQ2 ( const KnotArray &  grid,
double  x,
size_t  ix,
double  q2,
size_t  iq2,
std::vector< double > &  ret 
) const
inlineprotectedvirtual

Interpolate a single-point in (x,Q2), given x/Q2 values and subgrid indices, for all 11 standard flavours at once.

This can be overridden in derived classes for a more CPU-efficient implementation than the default looping over all flavours: often the grid coefficients for the point can be efficiently reused for each flavour.

Reimplemented in LHAPDF::LogBicubicInterpolator, LHAPDF::BicubicInterpolator, LHAPDF::BilinearInterpolator, and LHAPDF::LogBilinearInterpolator.

◆ type()

std::string LHAPDF::Interpolator::type ( ) const
inline
Todo:
Make an all-PID version of interpolateQ and Q2?

The name of this type of interpolator

Todo:
Would name() or scheme() be a better name? "Type" maybe confuses with the language type-system

The documentation for this class was generated from the following file: