### A free/open-source library for quantitative finance

Public Member Functions | Protected Member Functions
TrapezoidIntegral< IntegrationPolicy > Class Template Reference

Integral of a one-dimensional function. More...

`#include <ql/math/integrals/trapezoidintegral.hpp>`

Inherits Integrator.

List of all members.

## Public Member Functions

| TrapezoidIntegral (Real accuracy, Size maxIterations)

## Protected Member Functions

Real | integrate (const boost::function< Real(Real)> &f, Real a, Real b) const

## Detailed Description

### template<class IntegrationPolicy>
class QuantLib::TrapezoidIntegral< IntegrationPolicy >

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.