#include <cmath>
{
public:
double Regular(
double const& x)
const
{
}
{
}
double Local(
double const& x)
const
{
}
};
{
public:
p0qq2(): Expression() {}
double Regular(
double const& x)
const
{
return 4 *
apfel::CF *
apfel::CF * ( - 4 * log(x) / ( 1 - x ) - 4 * ( 1 + x ) * log(1 - x) + 3 * ( 1 + x ) * log(x) - ( x + 5 ) );
}
{
}
double Local(
double const& x)
const
{
return 4 *
apfel::CF *
apfel::CF * ( 4 * pow(log(1 - x),2) + 6 * log(1 - x) + 9. / 4. - 4 * pow(M_PI,2) / 6. ) ;
}
};
int main()
{
const apfel::Grid g{{{100, 1e-5, 3}, {100, 1e-1, 3}, {40, 8e-1, 3}}};
std::cout << d;
const p0qq p;
std::cout << "\nInitialization ..." << std::endl;
std::cout << "\nConvolution between operator and distribution (O * d) ..." << std::endl;
std::cout << "\nConvolution between two operators (O * O) ..." << std::endl;
const int nx = 100;
const double xmin = 1e-5;
const double xmax = 0.999;
const double xstp = exp( log(xmax / xmin) / ( nx - 1 ) );
std::cout << "\nChecking the numerical accuracy of O * d ... " << std::endl;
std::cout << std::scientific;
for (double x = xmin; x < xmax * 1.000001; x *= xstp)
{
const double Ix =
apfel::CF * ( - 2 * ( 3. / 2. - x - pow(x,2) / 2. ) + 4 * ( 1 - x ) * log(1 - x) + 3 * ( 1 - x ) + 2 * x * ( log(x) + 1 - x ) );
std::cout << x << "\t\t" << Odx << "\t\t" << Oxd << "\t\t" << Ix << "\t\t" << Odx / Ix << "\t\t" << Oxd / Ix << std::endl;
}
const p0qq2 p2;
std::cout << "\nChecking the numerical accuracy of O * O ... " << std::endl;
for (double x = xmin; x < xmax * 1.000001; x *= xstp)
std::cout << DObj << std::endl;
return 0;
}
The Distribution class defines one of the basic objects of APFEL++. This is essentially the discretis...
Definition distribution.h:22
The DoubleObject class is a collection of pairs of single objects (Distributions or Operators) accomp...
Definition doubleobject.h:37
The Expression class encapsulates in a proper form a given analytic expression in such a way that it ...
Definition expression.h:17
virtual double Local(double const &) const
Virtual local term.
Definition expression.h:55
Expression(double const &eta=1)
The "Expression" constructor.
virtual double Singular(double const &) const
Virtual singular term.
Definition expression.h:49
virtual double Regular(double const &) const
Virtual regular term.
Definition expression.h:43
The Grid class defines ab object that is essentially a collection of "SubGrid" objects plus other glo...
Definition grid.h:22
double Evaluate(double const &x) const
Function that evaluates the interpolated function on the joint grid.
The Operator class defines the basic object "Operator" which is essentially the convolution on the gr...
Definition operator.h:22
The Timer class computes the time elapsed between start and stop.
Definition timer.h:20
void stop(bool const &ForceDisplay=false)
This function stops the timer and reports the elapsed time in seconds since the last time the timer w...
Definition timer.h:36
void start()
This function starts the timer.
Definition timer.h:30
const double CF
Definition constants.h:148
double InnerProduct(Distribution const &d1, Distribution const &d2, double const &offset=0)
Function that computes the scala product bewteen two distributions. The product is computed using the...