Boost中的c++ Hermite插值算法

c++ Hermite interpolation algorithm in Boost

我正在尝试使用 Boost c++ 库进行 Hermite 插值,但它没有很好的文档记录,我也不是很了解。

我的情况是根据数据点计算某个 x 位置的 y 值,例如:

X: 0.9, 1.7, 2.55, 3.39...
Y: 0.9, 0.8, 0.85, 0.84...

并得到等于 x spaces (x space 0.5) 的结果:

X: 0.5, 1.00, 1.5, 2.00, 2.5, 3.0,...
Y: 0.8, 0.95, 0.8, 0.85, 0.9, 0.9,...

boost 对我有帮助吗?我在网上找到了更多 Hermite 的实现,但是示例和结果输出并不是我想要的。我认为那是因为我不明白它是如何工作的。当我读到 Hermite 时,我认为算法应该要求一些点、间距值和可能很少的其他输入值,然后计算 return 个新点,但我错了,现在丢失了..

http://www.boost.org/doc/libs/1_47_0/libs/math/doc/sf_and_dist/html/math_toolkit/special/sf_poly/hermite.html

也许有人使用过Hermite并且有过类似的案例?

嗯,首先,Hermite 是一位多产的数学家,所以 Hermite polynomials (an orthogonal family) are unrelated to Hermite interpolating polynomials that arise in the interpolation method

其次,当您具有前几个函数导数的值以及每个点的函数值时,将应用 Hermite 插值,因此它不适用于您的情况。

特别是在 Boost 中,我只能找到这种用于非均匀插值的算法:http://www.boost.org/doc/libs/1_65_0/libs/math/doc/html/math_toolkit/interpolate/barycentric.html — 希望它足以满足您的目的。

Boost 提供 barycentric rational interpolation for non-uniform spaced interpolation. This change landed in 1.65, so it's fairly new and you might have to update your boost. If you need uniform spacing and derivatives, evaluate this interpolant and equal spaced points and use the cubic_b_spline 插值。