2010-08-17 77 views
10

假设我有一个双精度数组,什么是使用Akima interpolation来抽样这个系列的好算法?我太愚蠢了,不能将数学描述翻译成代码。双数阵列的Akima插值

// values is an array of doubles 
// idx is the index of the left-hand value for the current interpolation 
// t is the normalized parameter between values[idx] and values[idx+1] 
// Don't worry about array bounds, I'll handle that separately. 
public double InterpolateAkima(double[] values, int idx, double t) 
{ 
    ...? 
} 
+3

它看起来像一个大量的工作,没有人会只编写了你。它看起来非常直截了当,但一些好的编码时间才能完成。不要犹豫,问你是否有一个你不明白的具体事情。 – 2010-08-17 19:14:40

+0

@Albin,我想是够了。立方插值就像10行代码,我希望所有这个数学可以精简到20行...... – 2010-08-17 19:50:38

回答

27
+0

另外:[由Jens-Peer Kuska实施的Mathematica](https://groups.google.com/d/msg/comp.soft-sys.math .mathematica/XAWwuMCV_8w/FZDMf3Pgsz0J)。 – 2011-06-21 23:08:30

+0

还有alglib(仅在VB6和delphi下提到)有C++,C#,python和其他实现。 – Dan 2013-05-09 09:06:58

+0

另一个C实现(GSL):https://www.gnu.org/software/gsl/manual/html_node/Interpolation-Types.html#Interpolation-Types – alfC 2014-08-28 06:41:25

7

在google代码搜索上找到了一些hits,但这不是我知道的地方。第一个结果是Math.NET,这可能会引起一些兴趣。

+3

+1:Math.NET的确有一个实现 – Bertvan 2010-09-07 18:51:07

+0

它在'MathNet.Numerics.Interpolation'命名空间 – Keith 2010-09-08 07:56:21

+0

http://mathnetnumerics.codeplex.com/wikipage?title=插入 – 2013-01-13 18:49:22