Himalaya
Li2f.cpp
Go to the documentation of this file.
1 // ====================================================================
2 // This file is part of Himalaya.
3 //
4 // Himalaya is licenced under the GNU General Public License (GNU GPL)
5 // version 3.
6 // ====================================================================
7 
8 #include "himalaya/mh2l/Li2f.hpp"
9 #include <complex>
10 
11 /// complex dilogarithm from FORTRAN module
12 extern "C" int li2c_(double*, double*, double*, double*);
13 
14 namespace himalaya {
15 
16 /// real dilogarithm from FORTRAN module
17 double li2(double x)
18 {
19  const std::complex<double> z(x, 0.);
20  return std::real(li2(z));
21 }
22 
23 /// complex dilogarithm from FORTRAN module
24 std::complex<double> li2(const std::complex<double>& z)
25 {
26  double re_in = z.real();
27  double im_in = z.imag();
28  double re_out = 0.;
29  double im_out = 0.;
30 
31  li2c_(&re_in, &im_in, &re_out, &im_out);
32 
33  return { re_out, im_out };
34 }
35 
36 } // namespace himalaya
Definition: H3.cpp:14
int li2c_(double *, double *, double *, double *)
complex dilogarithm from FORTRAN module
double li2(double x)
real dilogarithm from FORTRAN module
Definition: Li2f.cpp:17