Fast Methods for Cosmological Simulations
FastSim serves as a tool for quick N-body simulations in modified gravity.
anonymous_namespace{core_power.cpp}::Integr_obj_qawo Class Reference

QAWO adaptive integration for oscillatory functions. More...

Inheritance diagram for anonymous_namespace{core_power.cpp}::Integr_obj_qawo:
Collaboration diagram for anonymous_namespace{core_power.cpp}::Integr_obj_qawo:

Public Member Functions

 Integr_obj_qawo (double(*f)(double, void *), const double a, const double b, const double epsabs, const double epsrel, size_t limit, size_t n)
 
 ~Integr_obj_qawo ()
 
double operator() (double r, void *params)
 
- Public Member Functions inherited from anonymous_namespace{core_power.cpp}::Integr_obj
 Integr_obj (double(*f)(double, void *), const double a, const double b, const double epsabs, const double epsrel, const size_t limit)
 
 ~Integr_obj ()
 
void set_a (double a_new)
 
void set_b (double b_new)
 

Protected Attributes

gsl_integration_qawo_table * wf
 
- Protected Attributes inherited from anonymous_namespace{core_power.cpp}::Integr_obj
double result
 
double error
 
double a
 
double b
 
double L
 
double epsabs
 
double epsrel
 
size_t limit
 
gsl_function F
 
gsl_integration_workspace * w
 
int gsl_errno
 

Detailed Description

QAWO adaptive integration for oscillatory functions.

The QAWO algorithm is designed for integrands with an oscillatory factor, $\sin(\omega x)$ or $\cos(\omega x)$.

Definition at line 148 of file core_power.cpp.

Constructor & Destructor Documentation

anonymous_namespace{core_power.cpp}::Integr_obj_qawo::Integr_obj_qawo ( double(*)(double, void *)  f,
const double  a,
const double  b,
const double  epsabs,
const double  epsrel,
size_t  limit,
size_t  n 
)
inline

Definition at line 152 of file core_power.cpp.

153  :
154  Integr_obj(f, a, b, epsabs, epsrel, limit)
155  {
156  wf = gsl_integration_qawo_table_alloc(1, 1, GSL_INTEG_SINE, n);
157  }
Integr_obj(double(*f)(double, void *), const double a, const double b, const double epsabs, const double epsrel, const size_t limit)
Definition: core_power.cpp:53
anonymous_namespace{core_power.cpp}::Integr_obj_qawo::~Integr_obj_qawo ( )
inline

Definition at line 159 of file core_power.cpp.

160  {
161  gsl_integration_qawo_table_free(wf);
162  }

Member Function Documentation

double anonymous_namespace{core_power.cpp}::Integr_obj_qawo::operator() ( double  r,
void *  params 
)
inline

Definition at line 164 of file core_power.cpp.

References halomod_bm::params, and w.

165  {
166  gsl_integration_qawo_table_set(wf, r, L, GSL_INTEG_SINE);
167  F.params = params;
168  gsl_errno = gsl_integration_qawo(&F, a, epsabs, epsrel, limit, w, wf, &result, &error);
169  if (gsl_errno) throw std::runtime_error("GSL integration error: " + std::string(gsl_strerror(gsl_errno)));
170  else return result;
171  }
dictionary params
Definition: halomod_bm.py:27

Member Data Documentation

gsl_integration_qawo_table* anonymous_namespace{core_power.cpp}::Integr_obj_qawo::wf
protected

Definition at line 173 of file core_power.cpp.


The documentation for this class was generated from the following file: