Integral of a one-dimensional function. More...
#include <ql/math/integrals/trapezoidintegral.hpp>
Inherits Integrator.
Public Member Functions | |
TrapezoidIntegral (Real accuracy, Size maxIterations) | |
![]() | |
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 |
![]() | |
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.