24#ifndef quantlib_grid_hpp
25#define quantlib_grid_hpp
35 [[deprecated(
"Part of the old FD framework; copy this function in your codebase if needed")]]
42 [[deprecated(
"Part of the old FD framework; copy this function in your codebase if needed")]]
49 [[deprecated(
"Part of the old FD framework; copy this function in your codebase if needed")]]
56 Array result(steps+1);
57 for (
Size i=0; i<steps+1; i++)
58 result[i] = center + (i - steps/2.0)*dx;
63 Array result(steps+1);
64 Real x=xMin, dx=(xMax-xMin)/steps;
65 for (
Size i=0; i<steps+1; i++, x+=dx)
71 Array result(steps+1);
72 Real gridLogSpacing = (std::log(xMax) - std::log(xMin)) /
74 Real edx = std::exp(gridLogSpacing);
76 for (
Size j=1; j < steps+1; j++) {
77 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)