24#ifndef quantlib_grid_hpp
25#define quantlib_grid_hpp
38 Array result(steps+1);
39 for (
Size i=0; i<steps+1; i++)
40 result[i] = center + (i - steps/2.0)*dx;
45 Array result(steps+1);
46 Real x=xMin, dx=(xMax-xMin)/steps;
47 for (
Size i=0; i<steps+1; i++, x+=dx)
53 Array result(steps+1);
54 Real gridLogSpacing = (std::log(xMax) - std::log(xMin)) /
56 Real edx = std::exp(gridLogSpacing);
58 for (
Size j=1; j < steps+1; j++) {
59 result[j] = result[j-1]*edx;
1-D array used in linear algebra.
1-D array used in linear algebra.
std::size_t Size
size of a container
Array BoundedLogGrid(Real xMin, Real xMax, Size steps)
Array BoundedGrid(Real xMin, Real xMax, Size steps)
Array CenteredGrid(Real center, Real dx, Size steps)