#include <iostream>
#include <cmath>
#include <vector>
#include <memory>
int const nX = 20;
double const xLo = 0;
double const xHi = 2.0 *
M_PI;
double const range = xHi - xLo;
for (int i = 0; i < nX; ++i) {
x[i] = xLo +
static_cast<double>(i) / (nX - 1) * range;
}
int const nX2 = 100;
for (int i = 0; i < nX2; ++i) {
x2[i] = xLo + (((nX + 2.0) / nX) * static_cast<double>(i) / (nX2 - 1) - 1.0 / nX) * range;
}
for (int i = 0; i < nX2; ++i) {
cout << i <<
" " << x2[i] <<
" " << yinterpL->interpolate(x2[i]) <<
" "
<< yinterpS->interpolate(x2[i]) <<
" " <<
endl;
}
return 0;
}
std::shared_ptr< Interpolate > makeInterpolate(std::vector< double > const &x, std::vector< double > const &y, Interpolate::Style const style=Interpolate::AKIMA_SPLINE)
A factory function to make Interpolate objects.