1 // GetDP - Copyright (C) 1997-2021 P. Dular and C. Geuzaine, University of Liege
2 //
3 // See the LICENSE.txt file for license information. Please report all
4 // issues on https://gitlab.onelab.info/getdp/getdp/issues.
5 
6 #ifndef BESSEL_H
7 #define BESSEL_H
8 
9 #include <math.h>
10 #include <complex>
11 
12 #define BESSEL_ERROR_INPUT     1
13 #define BESSEL_OVERFLOW        2
14 #define BESSEL_HALF_ACCURACY   3
15 #define BESSEL_NO_ACCURACY     4
16 #define BESSEL_NO_CONVERGENCE  5
17 
18 // These routines provide a C++ interface to the Fortran Bessel
19 // functions from Donald E. Amos (Sandia National Laboratories)
20 
21 int BesselJn(double n, int num, double x, double *val);
22 int BesselSphericalJn(double n, int num, double x, double *val);
23 int BesselAltSphericalJn(double n, int num, double x, double *val);
24 
25 int BesselJnComplex(double n, int num, double xr, double xi, double *valr, double *vali);
26 int BesselKnComplex(double n, int num, double xr, double xi, double *valr, double *vali);
27 
28 int BesselYn(double n, int num, double x, double *val);
29 int BesselSphericalYn(double n, int num, double x, double *val);
30 int BesselAltSphericalYn(double n, int num, double x, double *val);
31 
32 int BesselHn(int type, double n, int num, double x, std::complex<double> *val);
33 int BesselSphericalHn(int type, double n, int num, double x, std::complex<double> *val);
34 int BesselAltSphericalHn(int type, double n, int num, double x, std::complex<double> *val);
35 
36 // Utilities for backward compatibility
37 
38 double Spherical_j_n(int n, double x);
39 double AltSpherical_j_n(int n, double x);
40 double Spherical_y_n(int n, double x);
41 double AltSpherical_y_n(int n, double x);
42 
43 #endif
44