ReFRACtor
fp_gsl_integrate.h
Go to the documentation of this file.
1 #ifndef FP_GSL_INTEGRATE_H
2 #define FP_GSL_INTEGRATE_H
3 #include <boost/function.hpp>
4 #include <boost/utility.hpp>
5 #include <gsl/gsl_integration.h>
6 #include <vector>
7 
8 namespace FullPhysics {
9 
10 /****************************************************************/
13 class GslIntegrate : public boost::noncopyable {
14 public:
15  GslIntegrate(int Max_intervals = 1000);
16  virtual ~GslIntegrate();
17  void integrate_err_est(const boost::function<double (double)>& F,
18  double xmin, double xmax,
19  double &Res, double& Error_est,
20  double eps_abs = 0.0,
21  double eps_rel = 1e-8,
22  int key = GSL_INTEG_GAUSS15) const;
23  void integrate_err_est(const boost::function<double (double)>& F,
24  double xmin, double xmax,
25  const std::vector<double>& breakpoints,
26  double &Res, double& Error_est,
27  double eps_abs = 0.0,
28  double eps_rel = 1e-8,
29  int key = GSL_INTEG_GAUSS15) const;
30 
31  double integrate(const boost::function<double (double)>& F,
32  double xmin, double xmax,
33  double eps_abs = 0.0,
34  double eps_rel = 1e-8,
35  int key = GSL_INTEG_GAUSS15) const;
36  double integrate(const boost::function<double (double)>& F,
37  double xmin, double xmax,
38  const std::vector<double>& breakpoints,
39  double eps_abs = 0.0,
40  double eps_rel = 1e-8,
41  int key = GSL_INTEG_GAUSS15) const;
42 
43 private:
44  gsl_integration_workspace *w;
45  int max_ninterval;
46 };
47 
48 }
49 #endif
GslIntegrate(int Max_intervals=1000)
This sets up the workspace need by GSL for integration.
void integrate_err_est(const boost::function< double(double)> &F, double xmin, double xmax, double &Res, double &Error_est, double eps_abs=0.0, double eps_rel=1e-8, int key=GSL_INTEG_GAUSS15) const
Calculate the definite integral of F from xmin to xmax.
This is a thin wrapper around the GSL integration function.
Contains classes to abstract away details in various Spurr Radiative Transfer software.
Definition: doxygen_python.h:1
double integrate(const boost::function< double(double)> &F, double xmin, double xmax, double eps_abs=0.0, double eps_rel=1e-8, int key=GSL_INTEG_GAUSS15) const
Version of integrate that only returns the results, without the error estimate.

Copyright © 2017, California Institute of Technology.
ALL RIGHTS RESERVED.
U.S. Government Sponsorship acknowledged.
Generated Fri Aug 24 2018 15:44:11