5#ifndef __HYPERSPHERICAL__
6#define __HYPERSPHERICAL__
14#define _HYPER_OVERFLOW_ 1e200
15#define _ONE_OVER_HYPER_OVERFLOW_ 1e-200
16#define _HYPER_SAFETY_ 1e-5
17#define _TRIG_PRECISSION_ 1e-7
18#define _HYPER_BLOCK_ 8
19#define _HYPER_CHUNK_ 16
20#define _TWO_OVER_THREE_ 0.666666666666666666666666666667e0
21#define _HIS_BYTE_ALIGNMENT_ 16
23struct HypersphericalInterpolationStructure {
30 std::vector<double> chi_at_phimin;
32 std::vector<double> x;
33 std::vector<double> sinK;
34 std::vector<double> cotK;
35 std::vector<double> phi;
36 std::vector<double> dphi;
39 std::vector<double> d2phi;
40 std::vector<double> d3phi;
42 HypersphericalInterpolationStructure() =
default;
45 HypersphericalInterpolationStructure(
int K,
59 static HypersphericalInterpolationStructure OnFixedSpacing(
int K,
74 HypersphericalInterpolationStructure(
int K,
83using HyperInterpStruct = HypersphericalInterpolationStructure;
93 std::vector<double> h_left;
94 std::vector<double> h_right;
95 std::vector<double> g_left;
96 std::vector<double> g_right;
107void hyperspherical_Hermite_locate(
const HyperInterpStruct* pHIS,
109 const double* xinterp,
115template <
bool DoPhi,
bool DoDPhi,
bool DoD2Phi>
116void hyperspherical_Hermite_evaluate(
const HyperInterpStruct* pHIS,
125struct WKB_parameters {
132void hyperspherical_forwards_recurrence(
int K,
139 const double* one_over_sqrtK,
141void hyperspherical_forwards_recurrence_chunk(
int K,
149 const double* one_over_sqrtK,
151void hyperspherical_backwards_recurrence(
int K,
158 const double* one_over_sqrtK,
161void hyperspherical_backwards_recurrence_chunk(
int K,
169 const double* one_over_sqrtK,
172bool hyperspherical_WKB(
int K,
int l,
double beta,
double y,
double* Phi);
173void hyperspherical_bessel_direct_vector(
174 int K,
double beta,
int* lvec,
int nl,
const double* xvec,
int nx,
double* Phi);
175void ClosedModY(
int l,
int beta,
double* y,
int* phisign,
int* dphisign);
176bool get_CF1(
int K,
int l,
double beta,
double cotK,
double* CF,
int* isign);
177bool CF1_from_Gegenbauer(
int l,
int beta,
double sinK,
double cotK,
double* CF);
178double airy_cheb_approx(
double z);
179double coef1(
double z);
180double coef2(
double z);
181double coef3(
double z);
182double coef4(
double z);
183double cheb(
double x,
int n,
const double A[]);
185double PhiWKB_minus_phiminabs(
double x,
const WKB_parameters& wkbparam);
187void hyperspherical_get_xmin_from_Airy(
188 int K,
int l,
double beta,
double xtol,
double phiminabs,
double* xmin,
int* fevals);
190bool fzero_ridder(FunctionRef<
double(
double x)> func,
199void hyperspherical_get_xmin_from_approx(
200 int K,
int l,
double nu,
double ignore1,
double phiminabs,
double* xmin,
int* ignore2);
218template <
int Order,
bool DoPhi,
bool DoDPhi,
bool DoD2Phi>
219void hyperspherical_Hermite_interpolation(
const HyperInterpStruct* pHIS,
222 const double* xinterp,
230extern template void hyperspherical_Hermite_evaluate<true, false, false>(
231 const HyperInterpStruct*,
int,
const HermiteLocations&,
int,
int,
double*,
double*,
double*);
232extern template void hyperspherical_Hermite_evaluate<true, true, true>(
233 const HyperInterpStruct*,
int,
const HermiteLocations&,
int,
int,
double*,
double*,
double*);
234extern template void hyperspherical_Hermite_evaluate<true, true, false>(
235 const HyperInterpStruct*,
int,
const HermiteLocations&,
int,
int,
double*,
double*,
double*);
236extern template void hyperspherical_Hermite_evaluate<true, false, true>(
237 const HyperInterpStruct*,
int,
const HermiteLocations&,
int,
int,
double*,
double*,
double*);
238extern template void hyperspherical_Hermite_evaluate<false, true, false>(
239 const HyperInterpStruct*,
int,
const HermiteLocations&,
int,
int,
double*,
double*,
double*);
240extern template void hyperspherical_Hermite_interpolation<4, true, false, false>(
241 const HyperInterpStruct*,
int,
int,
const double*,
double*,
double*,
double*);
242extern template void hyperspherical_Hermite_interpolation<4, false, true, false>(
243 const HyperInterpStruct*,
int,
int,
const double*,
double*,
double*,
double*);
244extern template void hyperspherical_Hermite_interpolation<4, true, true, false>(
245 const HyperInterpStruct*,
int,
int,
const double*,
double*,
double*,
double*);
246extern template void hyperspherical_Hermite_interpolation<4, true, false, true>(
247 const HyperInterpStruct*,
int,
int,
const double*,
double*,
double*,
double*);
248extern template void hyperspherical_Hermite_interpolation<4, true, true, true>(
249 const HyperInterpStruct*,
int,
int,
const double*,
double*,
double*,
double*);
250extern template void hyperspherical_Hermite_interpolation<6, true, false, false>(
251 const HyperInterpStruct*,
int,
int,
const double*,
double*,
double*,
double*);
252extern template void hyperspherical_Hermite_interpolation<6, false, true, false>(
253 const HyperInterpStruct*,
int,
int,
const double*,
double*,
double*,
double*);
254extern template void hyperspherical_Hermite_interpolation<6, true, true, false>(
255 const HyperInterpStruct*,
int,
int,
const double*,
double*,
double*,
double*);
256extern template void hyperspherical_Hermite_interpolation<6, true, false, true>(
257 const HyperInterpStruct*,
int,
int,
const double*,
double*,
double*,
double*);
258extern template void hyperspherical_Hermite_interpolation<6, true, true, true>(
259 const HyperInterpStruct*,
int,
int,
const double*,
double*,
double*,
double*);
Definition hyperspherical.h:90