60 std::vector<double>
m_x;
63 std::vector<double>
m_y;
78 std::shared_ptr<gsl_interp_accel>
m_acc;
131 std::vector<double>
x ()
const {
return m_x; }
139 double x (
const int i)
const {
return m_x[i]; }
145 std::vector<double>
y ()
const {
return m_y; }
153 double y (
const int i)
const {
return m_y[i]; }
201 std::vector<double>
eval_func (
const std::vector<double> xx)
const;
208 double D1v (
const double xx)
const;
215 double D2v (
const double xx)
const;
227 double integrate_qag (
const double a,
const double b,
const double rel_err=1.e-2,
const double abs_err=1.e-6,
const int limit_size=1000,
const int rule=6);
239 double integrate_cquad (
const double a,
const double b,
const double rel_err=1.e-2,
const double abs_err=1.e-6,
const int nevals=100);
254 double integrate_qaws (
const double a,
const double b,
const double alpha=0,
const double beta=0,
const int mu=0,
const int nu=0,
const double rel_err=1.e-2,
const double abs_err=1.e-6,
const int limit_size=1000);
265 double root (
const double x_low,
const double x_up,
const double fx0=0,
const double rel_err=1.e-2,
const double abs_err=1.e-6);
277 double root_D1v (
const double x_low,
const double x_up,
const double fx0=0,
const double rel_err=1.e-2,
const double abs_err=1.e-6);
289 double root_D2v (
const double x_low,
const double x_up,
const double fx0=0,
const double rel_err=1.e-2,
const double abs_err=1.e-6);
369 FuncGrid2D (
const std::vector<double>
x,
const std::vector<double>
y,
const std::vector<std::vector<double>> fxy,
const std::string interpType);
389 std::vector<double>
x ()
const {
return m_x; }
397 double x (
const int i)
const {
return m_x[i]; }
403 std::vector<double>
y ()
const {
return m_y; }
411 double y (
const int i)
const {
return m_y[i]; }
471 double operator () (
const double xx,
const double yy)
const;
479 std::vector<double>
eval_func (
const std::vector<std::vector<double>> xx)
const;
class CUBAwrapper that wrap CUBA routines for multidimensional integration
functions that wrap GSL routines for integration, root finding and minimization
double xmax() const
get the private member FuncGrid::m_xmax
double ymax() const
get the private member FuncGrid::m_ymax
double xmin() const
get the private member FuncGrid::m_xmin
std::vector< double > x() const
get the private member FuncGrid::m_x
std::shared_ptr< gsl_interp_accel > m_acc_x
GSL accelerator object.
const gsl_interp2d_type * m_type
GSL object used to set the interpolation type.
double IntegrateSuave(const double xmin, const double xmax, const double ymin, const double ymax) const
evaluate the 2D integral of the interpolated function using the Suave routine from CUBA libraries
FuncGrid2D()=default
default constructor
std::vector< double > m_x
x values
double operator()(const double xx, const double yy) const
overloading of the () operator
double m_xmin
minimum x value
double IntegrateCuhre(const double xmin, const double xmax, const double ymin, const double ymax) const
evaluate the 2D integral of the interpolated function using the Cuhre routine from CUBA libraries
double m_xmax
maximum x value
std::vector< double > m_y
y values
std::shared_ptr< gsl_spline2d > m_spline
GSL object used to interpolate.
double y(const int i) const
get the i-th element of the private member FuncGrid::m_y
std::string m_interpType
method used to interpolate
void free()
free the GSL objects
double size_y() const
get the private member FuncGrid::m_size
double IntegrateVegas(const double xmin, const double xmax, const double ymin, const double ymax) const
evaluate the 2D integral of the interpolated function using the Vegas routine from CUBA libraries
size_t m_size_x
size of the x vector
size_t m_size_y
size of the x vector
std::shared_ptr< gsl_interp_accel > m_acc_y
GSL accelerator object.
double m_ymin
minimum x value
double IntegrateDivonne(const double xmin, const double xmax, const double ymin, const double ymax) const
evaluate the 2D integral of the interpolated function using the Divonne routine from CUBA libraries
std::vector< double > y() const
get the private member FuncGrid::m_y
double size_x() const
get the private member FuncGrid::m_size
~FuncGrid2D()=default
default destructor
std::shared_ptr< double > m_fxy
y values
double x(const int i) const
get the i-th element of the private member FuncGrid::m_x
double m_ymax
maximum x value
double ymin() const
get the private member FuncGrid::m_ymin
std::vector< double > eval_func(const std::vector< std::vector< double >> xx) const
evaluate the function at the xx points
~FuncGrid()=default
default destructor
BinType m_binType
bin type
double size() const
get the private member FuncGrid::m_size
std::vector< double > m_y
y values
const gsl_interp_type * m_type
GSL object used to set the interpolation type.
void free()
free the GSL objects
std::shared_ptr< gsl_spline > m_spline
GSL object used to interpolate.
std::vector< double > eval_func(const std::vector< double > xx) const
evaluate the function at the xx points
double integrate_cquad(const double a, const double b, const double rel_err=1.e-2, const double abs_err=1.e-6, const int nevals=100)
compute the definite integral with GSL cquad method
double integrate_qaws(const double a, const double b, const double alpha=0, const double beta=0, const int mu=0, const int nu=0, const double rel_err=1.e-2, const double abs_err=1.e-6, const int limit_size=1000)
compute the definite integral with GSL qaws method
double root(const double x_low, const double x_up, const double fx0=0, const double rel_err=1.e-2, const double abs_err=1.e-6)
find roots with GSL brent method
double m_xmax
maximum x value
double D2v(const double xx) const
compute the second derivative at xx
double operator()(const double xx) const
overloading of the () operator
std::shared_ptr< gsl_interp_accel > m_acc
GSL accelerator object.
double D1v(const double xx) const
compute the first derivative at xx
std::vector< double > y() const
get the private member FuncGrid::m_y
size_t m_size
size of the x,y vectors, i.e. the grid size
double root_D1v(const double x_low, const double x_up, const double fx0=0, const double rel_err=1.e-2, const double abs_err=1.e-6)
find roots with GSL brent method for the first derivative
double integrate_qag(const double a, const double b, const double rel_err=1.e-2, const double abs_err=1.e-6, const int limit_size=1000, const int rule=6)
compute the definite integral with GSL qag method
double root_D2v(const double x_low, const double x_up, const double fx0=0, const double rel_err=1.e-2, const double abs_err=1.e-6)
find roots with GSL brent method for the second derivative
double xmax() const
get the private member FuncGrid::m_xmax
double xmin() const
get the private member FuncGrid::m_xmin
std::vector< double > x() const
get the private member FuncGrid::m_x
FuncGrid()=default
default constructor
double m_xmin
minimum x value
std::string m_interpType
method used to interpolate
std::vector< double > m_x
x values
double y(const int i) const
get the i-th element of the private member FuncGrid::m_y
double x(const int i) const
get the i-th element of the private member FuncGrid::m_x
static const double alpha
: the fine-structure constant
The global namespace of the CosmoBolognaLib