TrapezoidIntegral Class Reference
#include <ql/math/integrals/trapezoidintegral.hpp>
Inheritance diagram for TrapezoidIntegral:

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.
- Tests:
- the correctness of the result is tested by checking it against known good values.
Public Types | |
enum | Method { Default, MidPoint } |
Public Member Functions | |
TrapezoidIntegral (Real accuracy, Method method=Default, Size maxIterations=Null< Size >()) | |
Protected Member Functions | |
Method | method () const |
Method & | method () |
Real | integrate (const boost::function< Real(Real)> &f, Real a, Real b) const |
Real | defaultIteration (const boost::function< Real(Real)> &f, Real a, Real b, Real I, Size N) const |
Real | midPointIteration (const boost::function< Real(Real)> &f, Real a, Real b, Real I, Size N) const |
Protected Attributes | |
Method | method_ |