APFEL 4.8.0
A PDF evolution library in C++
Loading...
Searching...
No Matches
interpolator.h
Go to the documentation of this file.
1//
2// APFEL++ 2017
3//
4// Author: Valerio Bertone: valerio.bertone@cern.ch
5//
6
7#pragma once
8
9#include "apfel/grid.h"
10
11#include <array>
12
13namespace apfel
14{
22 {
23 public:
24 virtual ~Interpolator() = default;
25
30 Interpolator(Grid const& gr);
31
40 Interpolator(Grid const& gr,
41 std::vector<std::vector<double>> const& distsubgrid,
42 std::vector<double> const& distjointgrid);
43
51
56 double Evaluate(double const& x) const;
57
64 double Evaluate(double const& x, int const& ig) const;
65
72 double Derive(double const& x) const;
73
81 double Integrate(double const& a, double const& b) const;
83
96 virtual double InterpolantLog(int const& beta, double const& lnx, SubGrid const& sg) const = 0;
97
105 virtual double Interpolant(int const& beta, double const& x, SubGrid const& sg) const = 0;
106
112 virtual double DerInterpolant(int const&, double const&, SubGrid const&) const { return 0; };
113
119 virtual double IntInterpolant(int const&, double const&, double const&, SubGrid const&) const { return 0; };
120
128 virtual std::array<int, 2> SumBounds(double const& x, SubGrid const& sg) const = 0;
129
134 Grid const& GetGrid() const { return _grid; }
135 std::vector<std::vector<double>> const& GetDistributionSubGrid() const { return _distributionSubGrid; }
136 std::vector<double> const& GetDistributionJointGrid() const { return _distributionJointGrid; }
137 void Print() const { std::cout << *this << std::endl; }
139
140 protected:
141 Grid const& _grid;
142 std::vector<std::vector<double>> _distributionSubGrid;
143 std::vector<double> _distributionJointGrid;
144
145 friend std::ostream& operator << (std::ostream& os, Interpolator const& sg);
146 };
147
153 std::ostream& operator << (std::ostream& os, Interpolator const& in);
154}
The Grid class defines ab object that is essentially a collection of "SubGrid" objects plus other glo...
Definition grid.h:22
The Interpolator class is a mother class for the x-space interpolationand requires the implementation...
Definition interpolator.h:22
void Print() const
Print the Interpolator object.
Definition interpolator.h:137
std::vector< double > const & GetDistributionJointGrid() const
The distribution on the joint grid.
Definition interpolator.h:136
std::vector< std::vector< double > > _distributionSubGrid
The array with the distribution values on the subgrid.
Definition interpolator.h:142
double Evaluate(double const &x, int const &ig) const
Function that evaluates the interpolated function on a given subgrid.
Interpolator(Grid const &gr, std::vector< std::vector< double > > const &distsubgrid, std::vector< double > const &distjointgrid)
The Interpolator constructor.
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 interpolan...
virtual double IntInterpolant(int const &, double const &, double const &, SubGrid const &) const
Virtual method for the integral of the interpolating functions.
Definition interpolator.h:119
double Derive(double const &x) const
Function that evaluates the derivative of the interpolated function on the joint grid.
Grid const & _grid
The stored grid reference.
Definition interpolator.h:141
Interpolator(Grid const &gr)
The Interpolator constructor.
std::vector< double > _distributionJointGrid
The array with the distribution values on the joint grid.
Definition interpolator.h:143
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.
double Evaluate(double const &x) const
Function that evaluates the interpolated function on the joint grid.
virtual ~Interpolator()=default
friend 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 ...
Grid const & GetGrid() const
The grid.
Definition interpolator.h:134
virtual double DerInterpolant(int const &, double const &, SubGrid const &) const
Virtual method for the derivative of the interpolating functions.
Definition interpolator.h:112
double Integrate(double const &a, double const &b) const
Function that evaluates the integral of the interpolated function in the interval [a,...
std::vector< std::vector< double > > const & GetDistributionSubGrid() const
The distribution on the subgrids.
Definition interpolator.h:135
Class for the x-space interpolation SubGrids.
Definition subgrid.h:23
Namespace for all APFEL++ functions and classes.
Definition alphaqcd.h:14
std::ostream & operator<<(std::ostream &os, ConvolutionMap const &cm)
Method which prints ConvolutionMap with cout <<.