24#ifndef quantlib_gauss_laguerre_cosine_polynomial_hpp
25#define quantlib_gauss_laguerre_cosine_polynomial_hpp
33 template <
class mp_real>
41 virtual mp_real
m0()
const = 0;
42 virtual mp_real
m1()
const = 0;
46 m_.resize(
n+1, std::numeric_limits<mp_real>::quiet_NaN());
48 if (std::isnan(
m_[
n])) {
62 f_.resize(
n+1, std::numeric_limits<mp_real>::quiet_NaN());
64 if (std::isnan(
f_[
n])) {
76 mutable std::vector<mp_real>
m_,
f_;
90 template <
class mp_real>
96 m0_(1.0+1.0/(1.0+u*u)) { }
99 Real w(
Real x)
const override {
return std::exp(-x) * (1 + std::cos(this->
u_ * x)) /
m0_; }
102 mp_real
m0()
const override {
return 1 / (1 + this->
u_ * this->
u_); }
103 mp_real
m1()
const override {
104 return (1 - this->
u_*this->
u_) /
squared(1 + this->u_*this->u_);
122 template <
class mp_real>
128 m0_(1.0+u/(1.0+u*u)) { }
131 Real w(
Real x)
const override {
return std::exp(-x) * (1 + std::sin(this->
u_ * x)) /
m0_; }
134 mp_real
m0()
const override {
return this->
u_ / (1 + this->
u_ * this->
u_); }
135 mp_real
m1()
const override {
Gauss-Laguerre Cosine integration.
GaussLaguerreCosinePolynomial(Real u)
mp_real moment(Size n) const override
Real w(Real x) const override
mp_real m1() const override
mp_real m0() const override
Gauss-Laguerre Sine integration.
mp_real moment(Size n) const override
GaussLaguerreSinePolynomial(Real u)
Real w(Real x) const override
mp_real m1() const override
mp_real m0() const override
virtual mp_real m0() const =0
mp_real moment_(Size n) const
mp_real fact(Size n) const
std::vector< mp_real > f_
std::vector< mp_real > m_
virtual mp_real m1() const =0
GaussLaguerreTrigonometricBase(Real u)
std::size_t Size
size of a container
functionals and combinators not included in the STL
Gaussian quadrature defined by the moments of the distribution.