TrapezoidIntegral Class Reference#include <ql/Math/trapezoidintegral.hpp>
Inheritance diagram for TrapezoidIntegral:
[legend]List of all members.
Detailed Description
Integral of a one-dimensional function.
Given a target accuracy , the integral of a function between and is calculated by means of the trapezoid formula
where , , and with . The number of intervals is repeatedly increased until the target accuracy is reached.
|
Public Types |
| enum | Method { Default,
MidPoint
} |
Public Member Functions |
|
| TrapezoidIntegral (double accuracy, Method method=Default, Size maxIterations=Null< int >()) |
|
template<class F> double | operator() (const F &f, double a, double b) const |
|
double | accuracy () const |
|
double & | accuracy () |
|
Method | method () const |
|
Method & | method () |
|
Size | maxIterations () const |
|
Size & | maxIterations () |
Protected Member Functions |
|
template<class F> double | defaultIteration (const F &f, double a, double b, double I, Size N) const |
|
template<class F> double | midPointIteration (const F &f, double a, double b, double I, Size N) const |
Protected Attributes |
|
double | accuracy_ |
|
Method | method_ |
|
Size | maxIterations_ |
|