APFEL 4.8.0
A PDF evolution library in C++
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | Friends | List of all members
apfel::Interpolator Class Referenceabstract

The Interpolator class is a mother class for the x-space interpolationand requires the implementation of a specialized interpolation algorithm. The current version uses the joint grid object stored allocated by the Grid class. More...

#include <interpolator.h>

Inheritance diagram for apfel::Interpolator:
apfel::LagrangeInterpolator apfel::Distribution

Public Member Functions

virtual ~Interpolator ()=default
 
 Interpolator (Grid const &gr)
 The Interpolator constructor.
 
 Interpolator (Grid const &gr, std::vector< std::vector< double > > const &distsubgrid, std::vector< double > const &distjointgrid)
 The Interpolator constructor.
 
virtual double InterpolantLog (int const &beta, double const &lnx, SubGrid const &sg) const =0
 Pure virtual method for the interpolating functions polynomial in log(x).
 
virtual double Interpolant (int const &beta, double const &x, SubGrid const &sg) const =0
 Pure virtual method for the interpolating functions.
 
virtual double DerInterpolant (int const &, double const &, SubGrid const &) const
 Virtual method for the derivative of the interpolating functions.
 
virtual double IntInterpolant (int const &, double const &, double const &, SubGrid const &) const
 Virtual method for the integral of the interpolating functions.
 
virtual std::array< int, 2 > SumBounds (double const &x, SubGrid const &sg) const =0
 This purely virtual function computes the lower and upper bounds on which the the sum over interpolants is limited.
 
Evaluate functions

List of functions that perform the interpolation on the x-space grid. These also include the derivative and the integral of the interpolated function.

double Evaluate (double const &x) const
 Function that evaluates the interpolated function on the joint grid.
 
double Evaluate (double const &x, int const &ig) const
 Function that evaluates the interpolated function on a given subgrid.
 
double Derive (double const &x) const
 Function that evaluates the derivative of the interpolated function on the joint grid.
 
double Integrate (double const &a, double const &b) const
 Function that evaluates the integral of the interpolated function in the interval [a,b] on the joint grid.
 
Getters
Grid const & GetGrid () const
 The grid.
 
std::vector< std::vector< double > > const & GetDistributionSubGrid () const
 The distribution on the subgrids.
 
std::vector< double > const & GetDistributionJointGrid () const
 The distribution on the joint grid.
 
void Print () const
 Print the Interpolator object.
 

Protected Attributes

Grid const & _grid
 The stored grid reference.
 
std::vector< std::vector< double > > _distributionSubGrid
 The array with the distribution values on the subgrid.
 
std::vector< double > _distributionJointGrid
 The array with the distribution values on the joint grid.
 

Friends

std::ostream & operator<< (std::ostream &os, Interpolator const &sg)
 Method which prints Interpolator with cout <<. This only prints the first subgrid and is supposed to be used for debugging purposes.
 

Detailed Description

The Interpolator class is a mother class for the x-space interpolationand requires the implementation of a specialized interpolation algorithm. The current version uses the joint grid object stored allocated by the Grid class.

Constructor & Destructor Documentation

◆ ~Interpolator()

virtual apfel::Interpolator::~Interpolator ( )
virtualdefault

◆ Interpolator() [1/2]

apfel::Interpolator::Interpolator ( Grid const & gr)

The Interpolator constructor.

Parameters
grthe x-space grid object over which interpolation takes place

◆ Interpolator() [2/2]

apfel::Interpolator::Interpolator ( Grid const & gr,
std::vector< std::vector< double > > const & distsubgrid,
std::vector< double > const & distjointgrid )

The Interpolator constructor.

Parameters
grthe x-space grid object over which interpolation takes place
distsubgridthe vector of subgrids
distjointgridthe joint subgrid
Note
distjointgrid and distsubgrid are assumed to match the structure of the grid gr.

Member Function Documentation

◆ DerInterpolant()

virtual double apfel::Interpolator::DerInterpolant ( int const & ,
double const & ,
SubGrid const &  ) const
inlinevirtual

Virtual method for the derivative of the interpolating functions.

Returns
the derivarive of the interpolation weights

Reimplemented in apfel::LagrangeInterpolator.

◆ Derive()

double apfel::Interpolator::Derive ( double const & x) const

Function that evaluates the derivative of the interpolated function on the joint grid.

Parameters
xthe value in x where the derivative has to be computed
Returns
the derivative of the interpolated function
Examples
qgriddist_test.cc.

◆ Evaluate() [1/2]

double apfel::Interpolator::Evaluate ( double const & x) const

Function that evaluates the interpolated function on the joint grid.

Parameters
xthe value in x to be interpolated
Returns
the interpolated result
Examples
distribution_test.cc, massiveCF_test.cc, principal_value_test.cc, qgriddist_test.cc, structurefunction_cc_test.cc, structurefunction_massive_test.cc, structurefunction_nc_pol_test.cc, and structurefunction_nc_test.cc.

◆ Evaluate() [2/2]

double apfel::Interpolator::Evaluate ( double const & x,
int const & ig ) const

Function that evaluates the interpolated function on a given subgrid.

Parameters
xthe value in x to be interpolated
igthe subgrid index
Returns
the interpolated result

◆ GetDistributionJointGrid()

std::vector< double > const & apfel::Interpolator::GetDistributionJointGrid ( ) const
inline

The distribution on the joint grid.

◆ GetDistributionSubGrid()

std::vector< std::vector< double > > const & apfel::Interpolator::GetDistributionSubGrid ( ) const
inline

The distribution on the subgrids.

◆ GetGrid()

Grid const & apfel::Interpolator::GetGrid ( ) const
inline

The grid.

◆ Integrate()

double apfel::Interpolator::Integrate ( double const & a,
double const & b ) const

Function that evaluates the integral of the interpolated function in the interval [a,b] on the joint grid.

Parameters
athe lower integration bound
bthe upper integration bound
Returns
the integral of the interpolated function
Examples
qgriddist_test.cc.

◆ Interpolant()

virtual double apfel::Interpolator::Interpolant ( int const & beta,
double const & x,
SubGrid const & sg ) const
pure virtual

Pure virtual method for the interpolating functions.

Parameters
betathe x-space grid index
xthe value of the interpolation point
sgthe SubGrid over which the interpolant is defined
Returns
the interpolation weights

Implemented in apfel::LagrangeInterpolator.

◆ InterpolantLog()

virtual double apfel::Interpolator::InterpolantLog ( int const & beta,
double const & lnx,
SubGrid const & sg ) const
pure virtual

Pure virtual method for the interpolating functions polynomial in log(x).

Parameters
betathe x-space grid index
lnxthe value (of the log) of the interpolation point
sgthe SubGrid over which the interpolant is defined
Returns
the interpolation weights
Note
This interpolant is polynomial in log(x) and is used when computing operators on the grid. The reason is it's translation invariance on a logarithmically spaced grid that reduces the ammount of computations.

Implemented in apfel::LagrangeInterpolator.

◆ IntInterpolant()

virtual double apfel::Interpolator::IntInterpolant ( int const & ,
double const & ,
double const & ,
SubGrid const &  ) const
inlinevirtual

Virtual method for the integral of the interpolating functions.

Returns
the integral of the interpolation weights

Reimplemented in apfel::LagrangeInterpolator.

◆ Print()

void apfel::Interpolator::Print ( ) const
inline

Print the Interpolator object.

◆ SumBounds()

virtual std::array< int, 2 > apfel::Interpolator::SumBounds ( double const & x,
SubGrid const & sg ) const
pure virtual

This purely virtual function computes the lower and upper bounds on which the the sum over interpolants is limited.

Parameters
xthe value in x to be interpolated
sgthe SubGrid over which the interpolant is defined
Returns
the lower and upper bounds of the grid index

Implemented in apfel::LagrangeInterpolator.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
Interpolator const & sg )
friend

Method which prints Interpolator with cout <<. This only prints the first subgrid and is supposed to be used for debugging purposes.

Member Data Documentation

◆ _distributionJointGrid

std::vector<double> apfel::Interpolator::_distributionJointGrid
protected

The array with the distribution values on the joint grid.

◆ _distributionSubGrid

std::vector<std::vector<double> > apfel::Interpolator::_distributionSubGrid
protected

The array with the distribution values on the subgrid.

◆ _grid

Grid const& apfel::Interpolator::_grid
protected

The stored grid reference.


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