Integral of a one-dimensional function. More...
#include <ql/math/integrals/trapezoidintegral.hpp>
Inherits Integrator.
Public Member Functions | |
| TrapezoidIntegral (Real accuracy, Size maxIterations) | |
Public Member Functions inherited from Integrator | |
| Integrator (Real absoluteAccuracy, Size maxEvaluations) | |
| Real | operator() (const boost::function< Real(Real)> &f, Real a, Real b) const |
| Real | absoluteError () const |
| Size | numberOfEvaluations () const |
| virtual bool | integrationSuccess () const |
| void | setAbsoluteAccuracy (Real) |
| void | setMaxEvaluations (Size) |
| Real | absoluteAccuracy () const |
| Size | maxEvaluations () const |
Protected Member Functions | |
| Real | integrate (const boost::function< Real(Real)> &f, Real a, Real b) const |
Protected Member Functions inherited from Integrator | |
| virtual Real | integrate (const boost::function< Real(Real)> &f, Real a, Real b) const =0 |
| void | setAbsoluteError (Real error) const |
| void | setNumberOfEvaluations (Size evaluations) const |
| void | increaseNumberOfEvaluations (Size increase) const |
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.