vnl_adaptsimpson_integral.h
Go to the documentation of this file.
1 #ifndef VNL_ADAPTSIMPSON_INTEGRAL_H_
2 #define VNL_ADAPTSIMPSON_INTEGRAL_H_
3 //:
4 // \file
5 // \author Kongbin Kang at Brown
6 // \date Jan. 17th, 2005
7 //
9 #include <vnl/algo/vnl_algo_export.h>
10 
11 class VNL_ALGO_EXPORT vnl_adaptsimpson_integral : public vnl_definite_integral
12 {
13  private:
14  //: used to wrap the function class to an ordinary function.
15  static double int_fnct_(double* x);
16 
17  protected:
18 
19  //: maximum recursion depth
20  int depth_;
21 
22  //: real computation
23  double adaptivesimpson(double(*f)(double*), double a, double b, double eps, int level, int level_max);
24 
25  public:
26  vnl_adaptsimpson_integral(int depth = 32) : depth_(depth) {}
27 
28  //: a and b are integral limits respectively.
29  // n is the number of intervals used in integral.
30  // accuracy is the accuracy you want to achieve. Normally accuracy > 1e-11)
31  double integral(vnl_integrant_fnct *f, double a, double b, double accuracy);
32 };
33 
34 #endif
int depth_
maximum recursion depth.
the abstract 1D integrand function used for definite integral