Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-02 08:17:15

0001 //
0002 // APFEL++ 2017
0003 //
0004 // Author: Valerio Bertone: valerio.bertone@cern.ch
0005 //
0006 
0007 #pragma once
0008 
0009 #include <vector>
0010 #include <map>
0011 
0012 namespace apfel
0013 {
0014   /**
0015    * @name Fortran harmonic polylogarithms
0016    * @brief Harmonic polylogarithms up to weight five
0017    * @param x: real input argument
0018    * @param nw: maximum number of weights requested
0019    * @param Hr1: weight 1 harmonic polylogs (1D array)
0020    * @param Hr2: weight 2 harmonic polylogs (2D array)
0021    * @param Hr3: weight 3 harmonic polylogs (3D array)
0022    * @param Hr4: weight 4 harmonic polylogs (4D array)
0023    * @param Hr5: weight 5 harmonic polylogs (5D array)
0024    * @param n1: lower bound of the weight index requested
0025    * @param n2: upper bound of the weight index requested
0026    * @note This is just a suitably formatted wrapper of the original
0027    * fortran function (see src/kernel/hplog.f) to facilitate the call
0028    * of the harmonic logarithms from a C++ code.
0029    */
0030   extern "C"
0031   {
0032     double apf_hplog_(double *wx, int *wnw, double *Hr1, double *Hr2, double *Hr3, double *Hr4, double *Hr5, int *wn1, int *wn2);
0033   }
0034 
0035   /**
0036    * @name Special functions
0037    * Collection of special functions needed in the evaluation of some
0038    * expressions.
0039    */
0040   ///@{
0041   /**
0042    * @brief Real dilogarithm \f$\mathrm{Li}_2(x)\f$
0043    * @param x: the real argument
0044    * @return \f$\mathrm{Li}_2(x)\f$
0045    * @note Implementation translated by R.Brun from CERNLIB DILOG function C332.
0046    */
0047   double dilog(double const& x);
0048 
0049   /**
0050    * @brief Real trilogarithm \f$\mathrm{Li}_3(x)\f$
0051    * @param x: the real argument
0052    * @return \f$\mathrm{Li}_3(x)\f$
0053    * @note Speacial case of wgplg.
0054    */
0055   double trilog(double const& x);
0056 
0057   /**
0058    * @brief Function for the computation of the Nielsen's generalized dilogs.
0059    * @param n: integer argument
0060    * @param p: integer argument
0061    * @param x: real argument
0062    * @return \f$\mathrm{S}_{n,p}(x)\f$
0063    * @note Implementation translated from CERNLIB WGPLG.
0064    */
0065   double wgplg(int const& n, int const& p, double const& x);
0066 
0067   /**
0068    * @brief Function for the computation of the Harmonic polylogs up
0069    * to weight 5.
0070    * @param w: vector of weights
0071    * @param x: real argument
0072    * @return \f$\mathrm{H}(\{w\},x)\f$
0073    * @note C++ adaptation of the FORTRAN implementation discussed in
0074    * https://arxiv.org/pdf/1809.07084.pdf. The argument x is limited
0075    * to the interval [0, sqrt(2)-1].
0076    */
0077   double hpoly(std::vector<int> const& w, double const& x);
0078 
0079   /**
0080    * @brief Digamma function.
0081    * @param x: real argument
0082    * @return The digamma funciton computed at x.
0083    * @note C++ (real) adaptation of the FORTRAN (complex)
0084    * implementation present in the PEGASUS code (hep-ph/0408244).
0085    */
0086   double digamma(double const& x);
0087 
0088   /**
0089    * @brief Function that returns the index to be used with
0090    * unidimensional arrays returned by hplog_.
0091    * @param w: the packed vector of weights
0092    */
0093   int HPLogMap(std::vector<int> const& w);
0094 
0095   /**
0096    * @brief Function that returns the unpacked weights of the HPL
0097    * given the input vector.
0098    * @param w: the packed vector of weights
0099    */
0100   std::vector<int> UnpackWeights(std::vector<int> const& w);
0101   ///@}
0102 }