5#ifndef __HYPERSPHERICAL__
6#define __HYPERSPHERICAL__
13#define _HYPER_OVERFLOW_ 1e200
14#define _ONE_OVER_HYPER_OVERFLOW_ 1e-200
15#define _HYPER_SAFETY_ 1e-5
16#define _TRIG_PRECISSION_ 1e-7
17#define _HYPER_BLOCK_ 8
18#define _HYPER_CHUNK_ 16
19#define _TWO_OVER_THREE_ 0.666666666666666666666666666667e0
20#define _HIS_BYTE_ALIGNMENT_ 16
22typedef struct HypersphericalInterpolationStructure {
29 std::vector<double> chi_at_phimin;
31 std::vector<double> x;
32 std::vector<double> sinK;
33 std::vector<double> cotK;
34 std::vector<double> phi;
35 std::vector<double> dphi;
37 HypersphericalInterpolationStructure() =
default;
38 HypersphericalInterpolationStructure(
int K,
49struct WKB_parameters {
56void hyperspherical_forwards_recurrence(
int K,
63 double* one_over_sqrtK,
65void hyperspherical_forwards_recurrence_chunk(
int K,
73 double* one_over_sqrtK,
75void hyperspherical_backwards_recurrence(
int K,
82 double* one_over_sqrtK,
85void hyperspherical_backwards_recurrence_chunk(
int K,
93 double* one_over_sqrtK,
96bool hyperspherical_WKB(
int K,
int l,
double beta,
double y,
double* Phi);
97void hyperspherical_bessel_direct_vector(
98 int K,
double beta,
int* lvec,
int nl,
double* xvec,
int nx,
double* Phi);
99void ClosedModY(
int l,
int beta,
double* y,
int* phisign,
int* dphisign);
100bool get_CF1(
int K,
int l,
double beta,
double cotK,
double* CF,
int* isign);
101bool CF1_from_Gegenbauer(
int l,
int beta,
double sinK,
double cotK,
double* CF);
102double airy_cheb_approx(
double z);
103double coef1(
double z);
104double coef2(
double z);
105double coef3(
double z);
106double coef4(
double z);
107double cheb(
double x,
int n,
const double A[]);
109double PhiWKB_minus_phiminabs(
double x,
void* param);
111void hyperspherical_get_xmin_from_Airy(
112 int K,
int l,
double beta,
double xtol,
double phiminabs,
double* xmin,
int* fevals);
114bool fzero_ridder(
double (*func)(
double,
void*),
124void hyperspherical_get_xmin_from_approx(
125 int K,
int l,
double nu,
double ignore1,
double phiminabs,
double* xmin,
int* ignore2);
143template <
int Order,
bool DoPhi,
bool DoDPhi,
bool DoD2Phi>
144void hyperspherical_Hermite_interpolation(
const HyperInterpStruct* pHIS,
147 const double* xinterp,
155extern template void hyperspherical_Hermite_interpolation<4, true, false, false>(
156 const HyperInterpStruct*,
int,
int,
const double*,
double*,
double*,
double*);
157extern template void hyperspherical_Hermite_interpolation<4, false, true, false>(
158 const HyperInterpStruct*,
int,
int,
const double*,
double*,
double*,
double*);
159extern template void hyperspherical_Hermite_interpolation<4, true, true, false>(
160 const HyperInterpStruct*,
int,
int,
const double*,
double*,
double*,
double*);
161extern template void hyperspherical_Hermite_interpolation<4, true, false, true>(
162 const HyperInterpStruct*,
int,
int,
const double*,
double*,
double*,
double*);
163extern template void hyperspherical_Hermite_interpolation<4, true, true, true>(
164 const HyperInterpStruct*,
int,
int,
const double*,
double*,
double*,
double*);
165extern template void hyperspherical_Hermite_interpolation<6, true, false, false>(
166 const HyperInterpStruct*,
int,
int,
const double*,
double*,
double*,
double*);
167extern template void hyperspherical_Hermite_interpolation<6, false, true, false>(
168 const HyperInterpStruct*,
int,
int,
const double*,
double*,
double*,
double*);
169extern template void hyperspherical_Hermite_interpolation<6, true, true, false>(
170 const HyperInterpStruct*,
int,
int,
const double*,
double*,
double*,
double*);
171extern template void hyperspherical_Hermite_interpolation<6, true, false, true>(
172 const HyperInterpStruct*,
int,
int,
const double*,
double*,
double*,
double*);
173extern template void hyperspherical_Hermite_interpolation<6, true, true, true>(
174 const HyperInterpStruct*,
int,
int,
const double*,
double*,
double*,
double*);