QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
Integrates a vector or scalar function of vector domain. More...
#include <multidimintegrator.hpp>
Public Member Functions | |
MultidimIntegral (const std::vector< ext::shared_ptr< Integrator > > &integrators) | |
Real | operator() (const ext::function< Real(const std::vector< Real > &)> &f, const std::vector< Real > &a, const std::vector< Real > &b) const |
Private Member Functions | |
template<Size depth> | |
void | spawnFcts () const |
template<int T_N> | |
Real | vectorBinder (const ext::function< Real(const std::vector< Real > &)> &f, Real z, const std::vector< Real > &a, const std::vector< Real > &b) const |
template<int nT> | |
Real | integrate (const ext::function< Real(const std::vector< Real > &)> &f, const std::vector< Real > &a, const std::vector< Real > &b) const |
template<> | |
Real | vectorBinder (const ext::function< Real(const std::vector< Real > &)> &f, Real z, const std::vector< Real > &a, const std::vector< Real > &b) const |
template<> | |
void | spawnFcts () const |
Private Attributes | |
const std::vector< ext::shared_ptr< Integrator > > | integrators_ |
std::vector< ext::function< Real(const ext::function< Real(const std::vector< Real > &)> &, const std::vector< Real > &, const std::vector< Real > &) > > | integrationLevelEntries_ |
std::vector< Real > | varBuffer_ |
Static Private Attributes | |
static const Size | maxDimensions_ = 15 |
Integrates a vector or scalar function of vector domain.
Uses a collection of arbitrary 1D integrators along each of the dimensions. A template recursion along dimensions avoids calling depth test or virtual functions.
Definition at line 39 of file multidimintegrator.hpp.
|
explicit |
Definition at line 24 of file multidimintegrator.cpp.
Real operator() | ( | const ext::function< Real(const std::vector< Real > &)> & | f, |
const std::vector< Real > & | a, | ||
const std::vector< Real > & | b | ||
) | const |
f is the integrand function; a and b are the lower and upper integration limit domain for each dimension.
Definition at line 48 of file multidimintegrator.hpp.
|
private |
Definition at line 157 of file multidimintegrator.hpp.
|
private |
Definition at line 116 of file multidimintegrator.hpp.
|
private |
Definition at line 127 of file multidimintegrator.hpp.
|
staticprivate |
Definition at line 60 of file multidimintegrator.hpp.
|
private |
Definition at line 85 of file multidimintegrator.hpp.
|
mutableprivate |
Definition at line 105 of file multidimintegrator.hpp.
|
mutableprivate |
Definition at line 110 of file multidimintegrator.hpp.