37 intervals_(intervals),
54 - std::sin(2*
theta)/theta3);
55 const Real gamma = 4*(std::sin(
theta)/theta3 - std::cos(
theta)/theta2);
58 std::transform(x.
begin(), x.
end(),
v.begin(),
f);
63 f1 = [](
Real x) ->
Real {
return std::sin(x); };
64 f2 = [](
Real x) ->
Real {
return std::cos(x); };
67 f1 = [](
Real x) ->
Real {
return std::cos(x); };
68 f2 = [](
Real x) ->
Real {
return std::sin(x); };
71 QL_FAIL(
"unknown integration type");
78 for (
Size i=1; i <=
n_; ++i) {
79 c_2n +=
v[2*i] *f2(
t_*x[2*i]);
80 c_2n_1 +=
v[2*i-1]*f2(
t_*x[2*i-1]);
85 +
beta*c_2n + gamma*c_2n_1);
1-D array used in linear algebra.
1-D array used in linear algebra.
const_iterator end() const
Size size() const
dimension of the array
const_iterator begin() const
FilonIntegral(Type type, Real t, Size intervals)
Real integrate(const ext::function< Real(Real)> &f, Real a, Real b) const override
template class providing a null value for a given type.
Classes and functions for error handling.
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
#define QL_FAIL(message)
throw an error (possibly with file and line information)
ext::function< Real(Real)> b
Filon's formulae for sine and cosine Integrals.
std::size_t Size
size of a container
functionals and combinators not included in the STL
ext::shared_ptr< BlackVolTermStructure > v