32 for (
Size i=0; i <
n-1; ++i) {
33 sum += (x[i+1]-x[i])*(
f[i]+
f[i+1]);
47 for (
Size j=0; j <
n-2; j+=2) {
48 const Real dxj = x[j+1]-x[j];
49 const Real dxjp1 = x[j+2]-x[j+1];
52 const Real dd = dxj+dxjp1;
53 const Real k = dd/(6*dxjp1*dxj);
55 const Real gamma = dxj*(2*dxjp1-dxj);
60 sum += 0.5*(x[
n-1]-x[
n-2])*(
f[
n-1]+
f[
n-2]);
73 for(
Size i=0;i<
n-1;++i) {
89 Real sum = 0.0, x = a +
d;
90 for(
Size i=1;i<
n;i+=2) {
97 for(
Size i=2;i<
n-1;i+=2) {
105 sum += 1.5*
f(
b)+2.5*
f(
b-
d);
1-D array used in linear algebra.
Size size() const
dimension of the array
Real operator()(const Array &x, const Array &f) const
Real integrate(const ext::function< Real(Real)> &f, Real a, Real b) const override
Real operator()(const Array &x, const Array &f) const
Real integrate(const ext::function< Real(Real)> &f, Real a, Real b) const override
Size maxEvaluations() const
void increaseNumberOfEvaluations(Size increase) const
integrals on non uniform grids
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
ext::function< Real(Real)> b
std::size_t Size
size of a container