58 struct STR_generic_func_GSL
66 std::vector<double> parameters_return;
83 void check_GSL_fail (
const int status,
const bool exit,
const std::string CBLfunction,
const std::string GSLroutine);
145 double GSL_derivative (gsl_function Func,
const double xx,
const double hh,
const double prec=1.e-2);
166 double GSL_integrate_romberg (gsl_function Func,
const double a,
const double b,
const int npoints,
const double eps_rel=1.e-4,
const double eps_abs=1.e-12);
184 double GSL_integrate_cquad (gsl_function func,
const double a,
const double b,
const double rel_err=1.e-3,
const double abs_err=0,
const int nevals=100);
197 double GSL_integrate_qag (gsl_function Func,
const double a,
const double b,
const double rel_err=1.e-3,
const double abs_err=0,
const int limit_size=1000,
const int rule=6);
209 double GSL_integrate_qags (gsl_function Func,
const double a,
const double b,
const double rel_err=1.e-3,
const double abs_err=0,
const int limit_size=1000);
225 double GSL_integrate_qaws (gsl_function Func,
const double a,
const double b,
const double alpha=0,
const double beta=0,
const int mu=1,
const int nu =0,
const double rel_err=1.e-3,
const double abs_err=0,
const int limit_size=1000);
236 double GSL_integrate_qagiu (gsl_function Func,
const double a,
const double rel_err=1.e-3,
const double abs_err=0,
const int limit_size=1000);
327 double GSL_integrate_qag (
FunctionDoubleDouble func,
const double a,
const double b,
const double rel_err=1.e-3,
const double abs_err=0,
const int limit_size=1000,
const int rule=6);
377 double GSL_integrate_qaws (
FunctionDoubleDouble func,
const double a,
const double b,
const double alpha=0,
const double beta=0,
const int mu=1,
const int nu =0,
const double rel_err=1.e-3,
const double abs_err=0,
const int limit_size=1000);
418 double GSL_integrate_qag (
FunctionDoubleDoublePtrVectorRef func, std::shared_ptr<void> pp, std::vector<double> par,
const double a,
const double b,
const double rel_err=1.e-3,
const double abs_err=0,
const int limit_size=1000,
const int rule=6);
475 double GSL_integrate_qaws (
FunctionDoubleDoublePtrVectorRef func, std::shared_ptr<void> pp, std::vector<double> par,
const double a,
const double b,
const double alpha=0,
const double beta=0,
const int mu=1,
const int nu =0,
const double rel_err=1.e-3,
const double abs_err=0,
const int limit_size=1000);
486 double GSL_root_brent (gsl_function Func,
const double low_guess,
const double up_guess,
const double rel_err=1.e-3,
const double abs_err=0);
512 std::vector<double>
GSL_minimize_nD (
FunctionDoubleVector func,
const std::vector<double> start,
const std::vector<std::vector<double>> ranges,
const unsigned int max_iter=1000,
const double tol=1.e-6,
const double epsilon=0.1);
526 std::vector<double>
GSL_minimize_nD (
FunctionDoubleVectorRef func,
const std::vector<double> start,
const std::vector<std::vector<double>> ranges,
const unsigned int max_iter=1000,
const double tol=1.e-6,
const double epsilon=0.1);
552 double GSL_polynomial_eval (
const double x,
const std::shared_ptr<void> fixed_parameters,
const std::vector<double> coeff);
562 void GSL_polynomial_root (
const std::vector<double> coeff, std::vector<std::vector<double>> &root);
Useful generic functions.
static const double defaultDouble
default double value
static const double alpha
: the fine-structure constant
double GSL_minimize_1D(FunctionDoubleDouble func, const double start, double min=par::defaultDouble, double max=-par::defaultDouble, const int max_iter=1000, const bool verbose=false)
minimize the provided function using GSL procedure
double generic_function(const double xx, void *params)
function used to integrate interpolated function
double generic_roots(double xx, void *params)
generic roots
std::vector< double > GSL_minimize_nD(FunctionDoubleVector func, const std::vector< double > start, const std::vector< std::vector< double >> ranges, const unsigned int max_iter=1000, const double tol=1.e-6, const double epsilon=0.1)
minimize the provided function using GSL procedure
double generic_minimizer(const gsl_vector *xx, void *params)
generic roots
double GSL_derivative(gsl_function Func, const double xx, const double hh, const double prec=1.e-2)
the derivative of a function
double GSL_integrate_qagiu(gsl_function Func, const double a, const double rel_err=1.e-3, const double abs_err=0, const int limit_size=1000)
integral, computed using the GSL qagiu method
void GSL_polynomial_root(const std::vector< double > coeff, std::vector< std::vector< double >> &root)
find polynomial roots
double GSL_integrate_qags(gsl_function Func, const double a, const double b, const double rel_err=1.e-3, const double abs_err=0, const int limit_size=1000)
integral, computed using the GSL qags method
double GSL_integrate_romberg(gsl_function Func, const double a, const double b, const int npoints, const double eps_rel=1.e-4, const double eps_abs=1.e-12)
integral, using the gsl romberg method
double GSL_integrate_cquad(gsl_function func, const double a, const double b, const double rel_err=1.e-3, const double abs_err=0, const int nevals=100)
integral, using the gsl cquad method
void check_GSL_fail(const int status, const bool exit, const std::string CBLfunction, const std::string GSLroutine)
Function used to check output of the wrapped GSL routines.
double generic_minimizer_return(const gsl_vector *xx, void *params)
generic roots
double GSL_integrate_qaws(gsl_function Func, const double a, const double b, const double alpha=0, const double beta=0, const int mu=1, const int nu=0, const double rel_err=1.e-3, const double abs_err=0, const int limit_size=1000)
integral, computed using the GSL qaws method
double GSL_polynomial_eval(const double x, const std::shared_ptr< void > fixed_parameters, const std::vector< double > coeff)
evaluate a polynomial
double GSL_root_brent(gsl_function Func, const double low_guess, const double up_guess, const double rel_err=1.e-3, const double abs_err=0)
function to find roots using GSL qag method
double GSL_integrate_qag(gsl_function Func, const double a, const double b, const double rel_err=1.e-3, const double abs_err=0, const int limit_size=1000, const int rule=6)
integral, computed using the GSL qag method
The global namespace of the CosmoBolognaLib
std::function< double(std::vector< double >)> FunctionDoubleVector
typedef of a function returning a double with a vector in input
std::function< double(double)> FunctionDoubleDouble
typedef of a function returning a double with a double in input
std::function< double(double, std::shared_ptr< void >, std::vector< double > &)> FunctionDoubleDoublePtrVectorRef
typedef of a function returning a double with a double, a pointer and a vector reference in input
std::function< double(std::vector< double > &)> FunctionDoubleVectorRef
typedef of a function returning a double with a vector reference in input