36#ifndef TRIUMVIRATE_INCLUDE_MATHS_HPP_INCLUDED_
37#define TRIUMVIRATE_INCLUDE_MATHS_HPP_INCLUDED_
39#include <gsl/gsl_interp.h>
40#include <gsl/gsl_sf_bessel.h>
41#include <gsl/gsl_sf_coupling.h>
42#include <gsl/gsl_sf_gamma.h>
43#include <gsl/gsl_sf_legendre.h>
44#include <gsl/gsl_sf_result.h>
45#include <gsl/gsl_spline.h>
55#define PURE __attribute__((pure))
68extern const std::complex<double>
M_I;
196double wigner_3j(
int j1,
int j2,
int j3,
int m1,
int m2,
int m3);
219 const int ell,
const int m,
double pos[3]
234 const int ell,
const int m,
235 const double boxsize[3],
const int ngrid[3],
236 std::vector< std::complex<double> >& ylm_out
252 const int ell,
const int m,
253 const double boxsize[3],
const int ngrid[3],
254 std::vector< std::complex<double> >& ylm_out
297 double eval(
double x);
305 double split = 1000.;
308 gsl_interp_accel* accel;
double eval(double x)
Evaluate the interpolated function.
SphericalBesselCalculator(const int ell)
Construct the interpolated function calculator.
~SphericalBesselCalculator()
Destruct the interpolated function.
Reduced spherical harmonics.
static void store_reduced_spherical_harmonic_in_config_space(const int ell, const int m, const double boxsize[3], const int ngrid[3], std::vector< std::complex< double > > &ylm_out)
Store reduced spherical harmonics computed in configuration space.
static void store_reduced_spherical_harmonic_in_fourier_space(const int ell, const int m, const double boxsize[3], const int ngrid[3], std::vector< std::complex< double > > &ylm_out)
Store reduced spherical harmonics computed in Fourier space.
static std::complex< double > calc_reduced_spherical_harmonic(const int ell, const int m, double pos[3])
Calculate the reduced spherical harmonic.
Provide tracking of program resources and exceptions.
std::complex< double > eval_complex_in_polar(double r, double theta)
Evaluate a complex number in the polar form.
double get_vec3d_magnitude(std::vector< double > vec)
Return the magnitude of a 3-d vector.
std::complex< double > eval_gamma_lanczos(std::complex< double > z)
Evaluate the gamma function on the complex plane using the Lanczos approximation.
void get_lngamma_parts(double x, double y, double &lnr, double &theta)
Get the real and imaginary parts of the log-gamma function .
std::complex< double > eval_gamma_lnratio(double mu, std::complex< double > nu)
Evaluate the logarithm of the ratio of two gamma functions.
std::complex< double > eval_lanczos_approx_series(std::complex< double > z)
Evaluate the Lanczos approximation series for the gamma function.
const std::complex< double > M_I
imaginary unit
const double eps_coupling
zero-tolerance for Wigner 3-j coupling coefficients
double wigner_3j(int j1, int j2, int j3, int m1, int m2, int m3)
Calculate Wigner 3-j symbol.