24 namespace chebyshev_interpolation_detail {
27 std::transform(std::begin(x), std::end(x), std::begin(
t),
f);
39 std::begin(
x_), std::end(
x_), std::begin(
y_)
48 chebyshev_interpolation_detail::apply(
63 for (
Size i=0; i <
n; ++i)
64 t[i] = -std::cos((i+0.5)*
M_PI/
n);
67 for (
Size i=0; i <
n; ++i)
68 t[i] = -std::cos(i*
M_PI/(
n-1));
71 QL_FAIL(
"unknonw Chebyshev interpolation points type");
78 "interpolation override has the wrong length");
80 std::copy(
y.begin(),
y.end(),
y_.
begin());
chebyshev interpolation between discrete Chebyshev nodes
1-D array used in linear algebra.
const Real * const_iterator
Size size() const
dimension of the array
const_iterator begin() const
ChebyshevInterpolation(const Array &y, PointsType pointsType=SecondKind)
void updateY(const Array &y)
ext::shared_ptr< Impl > impl_
#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)
std::size_t Size
size of a container
Array apply(const Array &x, const ext::function< Real(Real)> &f)