00001 #ifndef VNL_SIMPSON_INTEGRAL_H_ 00002 #define VNL_SIMPSON_INTEGRAL_H_ 00003 //: 00004 // \file 00005 // \author Kongbin Kang at Brown 00006 // \date Jan. 17th, 2005 00007 // 00008 #include <vnl/vnl_definite_integral.h> 00009 00010 class vnl_simpson_integral : public vnl_definite_integral 00011 { 00012 private: 00013 //: used to extract integrand functions of the vnl_integrant_fnct. 00014 static double int_fnct_(double* x); 00015 00016 public: 00017 00018 vnl_simpson_integral() {} 00019 00020 //: a and b are integral limits respectively. 00021 // n is the number of intervals used in integral. 00022 // The actual subinterval used is 2* num_intervals_ 00023 double integral(vnl_integrant_fnct *f, double a, double b, long n); 00024 }; 00025 00026 #endif