core/vnl/algo/vnl_simpson_integral.cxx
Go to the documentation of this file.
00001 #include "vnl_simpson_integral.h"
00002 #include <vnl/algo/vnl_netlib.h>
00003 
00004 double vnl_simpson_integral::int_fnct_(double* x)
00005 {
00006   return  pfnct_->f_(*x);
00007 }
00008 
00009 double vnl_simpson_integral::integral(vnl_integrant_fnct* f, double a, double b, long n)
00010 {
00011 
00012   double res = 0;
00013  
00014   //set the function
00015   pfnct_ = f;
00016   
00017   v3p_netlib_simpru_(&vnl_simpson_integral::int_fnct_, &a, &b, &n, &res);
00018 
00019   return res;
00020 }