core
vnl
algo
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
//
8
#include <
vnl/vnl_definite_integral.h
>
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
vnl_adaptsimpson_integral
Definition:
vnl_adaptsimpson_integral.h:11
vnl_adaptsimpson_integral::vnl_adaptsimpson_integral
vnl_adaptsimpson_integral(int depth=32)
Definition:
vnl_adaptsimpson_integral.h:26
vnl_integrant_fnct
Definition:
vnl_integrant_fnct.h:10
vnl_adaptsimpson_integral::depth_
int depth_
maximum recursion depth.
Definition:
vnl_adaptsimpson_integral.h:20
vnl_definite_integral
Definition:
vnl_definite_integral.h:15
vnl_definite_integral.h
the abstract 1D integrand function used for definite integral
Generated by
1.8.15