43 vector<double>
cbl::wrapper::fftlog::transform_FFTlog (
const std::vector<double> yy,
const int dir,
const std::vector<double> xx,
const std::vector<double> fx,
const double mu,
const double q,
const double kr,
const int kropt)
45 vector<double> _yy, _fy;
50 vector<double> interpolated_values = interp.
eval_func(yy);
54 return interpolated_values;
61 void cbl::wrapper::fftlog::transform_FFTlog (std::vector<double> &yy, std::vector<double> &fy,
const int dir,
const std::vector<double> xx,
const std::vector<double> fx,
const double mu,
const double q,
const double kr,
const int kropt)
63 const int NMAX = 4096;
68 double wsave[2*NMAX+3*(NMAX/2)+19];
79 double dlogx = (xmax-xmin)/(n-1);
80 double dlnx = dlogx*log(10.);
82 double ci = double(n+1)/2;
84 double logxmedian = (xmax+xmin)/2;
87 for (
int i=0; i<n; i++)
92 double logymedian = log10(_kr)-logxmedian;
94 double rk = pow(10, logxmedian - logymedian);
97 ErrorCBL(
"problems in the FFTlog computation!",
"transform_FFTlog",
"FFTlog.cpp");
101 yy.erase(yy.begin(), yy.end()); fy.erase(fy.begin(), fy.end());
103 for (
int i=0; i<n; i++) {
104 double _y = pow(10., logymedian + ( i+1 - ci ) * dlogx );
106 fy.push_back(fact*ap[i]/_y);
Wrapper for fftlog wripper.
void free()
free the GSL objects
std::vector< double > eval_func(const std::vector< double > xx) const
evaluate the function at the xx points
static const double pi
: the ratio of a circle's circumference to its diameter
std::vector< double > transform_FFTlog(const std::vector< double > yy, const int dir, const std::vector< double > xx, const std::vector< double > fx, const double mu=0, const double q=0, const double kr=1, const int kropt=0)
wrapper of the FFTlog to compute the discrete Fourier sine or cosine transform of a logarithmically...
void fftl_(int *_n, double *_a, double *_rk, int *_dir, double *_wsave)
wrapper of the fftl subroutine contained in External/fftlog-f90-master/fftlog.f This subroutine compu...
void fhti_(int *_n, double *_mu, double *_q, double *_dlnr, double *_kr, int *_kropt, double *_wsave, int *_ok)
wrapper of the fhti subroutine contained in External/fftlog-f90-master/fftlog.f This is an initializa...
T Min(const std::vector< T > vect)
minimum element of a std::vector
int ErrorCBL(const std::string msg, const std::string functionCBL, const std::string fileCBL, const cbl::glob::ExitCode exitCode=cbl::glob::ExitCode::_error_)
throw an exception: it is used for handling exceptions inside the CosmoBolognaLib
T Max(const std::vector< T > vect)
maximum element of a std::vector