vnl_simpson_integral.cxx
Go to the documentation of this file.
1 #include "vnl_simpson_integral.h"
2 #include <vnl/algo/vnl_netlib.h>
3 
5 {
6  return pfnct_->f_(*x);
7 }
8 
9 double vnl_simpson_integral::integral(vnl_integrant_fnct* f, double a, double b, long n)
10 {
11 
12  double res = 0;
13 
14  //set the function
15  pfnct_ = f;
16 
17  v3p_netlib_simpru_(&vnl_simpson_integral::int_fnct_, &a, &b, &n, &res);
18 
19  return res;
20 }
double integral(vnl_integrant_fnct *f, double a, double b, long n)
a and b are integral limits respectively.
static double int_fnct_(double *x)
used to extract integrand functions of the vnl_integrant_fnct.
static vnl_integrant_fnct * pfnct_
virtual double f_(double)=0
Declare in a central place the list of symbols from netlib.