QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
FilonIntegral Class Reference

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

#include <ql/math/integrals/filonintegral.hpp>

+ Inheritance diagram for FilonIntegral:
+ Collaboration diagram for FilonIntegral:

Public Types

enum  Type { Sine , Cosine }
 

Public Member Functions

 FilonIntegral (Type type, Real t, Size intervals)
 
- Public Member Functions inherited from Integrator
 Integrator (Real absoluteAccuracy, Size maxEvaluations)
 
virtual ~Integrator ()=default
 
Real operator() (const ext::function< Real(Real)> &f, Real a, Real b) const
 
void setAbsoluteAccuracy (Real)
 
void setMaxEvaluations (Size)
 
Real absoluteAccuracy () const
 
Size maxEvaluations () const
 
Real absoluteError () const
 
Size numberOfEvaluations () const
 
virtual bool integrationSuccess () const
 

Protected Member Functions

Real integrate (const ext::function< Real(Real)> &f, Real a, Real b) const override
 
- Protected Member Functions inherited from Integrator
void setAbsoluteError (Real error) const
 
void setNumberOfEvaluations (Size evaluations) const
 
void increaseNumberOfEvaluations (Size increase) const
 

Private Attributes

const Type type_
 
const Real t_
 
const Size intervals_
 
const Size n_
 

Detailed Description

Integral of a one-dimensional function.

Given a number \( N \) of intervals, the integral of a function \( f \) between \( a \) and \( b \) is calculated by means of Filon's sine and cosine integrals

References: Abramowitz, M. and Stegun, I. A. (Eds.). Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables, 9th printing. New York: Dover, pp. 890-891, 1972.

Tests:
the correctness of the result is tested by checking it against known good values.

Definition at line 46 of file filonintegral.hpp.

Member Enumeration Documentation

◆ Type

enum Type
Enumerator
Sine 
Cosine 

Definition at line 48 of file filonintegral.hpp.

Constructor & Destructor Documentation

◆ FilonIntegral()

FilonIntegral ( Type  type,
Real  t,
Size  intervals 
)

Definition at line 33 of file filonintegral.cpp.

Member Function Documentation

◆ integrate()

Real integrate ( const ext::function< Real(Real)> &  f,
Real  a,
Real  b 
) const
overrideprotectedvirtual

Implements Integrator.

Definition at line 42 of file filonintegral.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ type_

const Type type_
private

Definition at line 55 of file filonintegral.hpp.

◆ t_

const Real t_
private

Definition at line 56 of file filonintegral.hpp.

◆ intervals_

const Size intervals_
private

Definition at line 57 of file filonintegral.hpp.

◆ n_

const Size n_
private

Definition at line 57 of file filonintegral.hpp.