双精度数组的 Akima 插值
假设我有一个双精度数组,那么使用 对该系列进行采样的好算法是什么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)
{
...?
}
Assuming I have an array of doubles, what's a good algorithm to sample this series using Akima interpolation? I'm too stupid to translate that mathematical description into code.
// 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)
{
...?
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
重新发布并扩展我对另一个SO问题的回答,该问题作为该问题的重复项而被关闭 - 正如建议的通过对该问题的评论。
Akima的原始论文:
“基于局部程序的插值和平滑曲线拟合的新方法”,ACM 杂志 17, 4 (1970), 589-602
http://www.leg.ufpr.br/lib/exe/fetch.php/wiki:internas:biblioteca:akima.pdf
C 实现
https://github.com/ampl/gsl/blob/master/interpolation/akima.c
C# 实现
https://gist.github.com /dreikanter/3526685
Delphi 实现(请参阅 delphi/src/spline3.pas 中的过程 BuildAkimaSpline)
http://www.alglib.net/translator/re/alglib-2.6.0.delphi.zip
Akima 的 Fortran 66 实现
http://cran.r-project.org/web/packages/akima/
Fortran 90 实现
http://miyoshi.googlecode.com/svn-history/r72/trunk/common/common .f90
Java 实现
https://commons.apache.org/proper/commons-math/jacoco/org.apache.commons.math3.analysis.interpolation/AkimaSplineInterpolator.java.html
Lisp 实现“用于 AutoCAD 2d 折线”
http://autocad.xarch。 at/code/candido/akima.lsp
Matlab实现
http:// www.mathworks.se/matlabcentral/fileexchange/1814-akima-interpolation
Pascal 实现 (计划说明)
http://jean -pierre.moreau.pagesperso-orange.fr/Pascal/akima_pas.txt
Python 实现
http://www.lfd.uci.edu/~gohlke/code/akima.py.html
VB6 实现(参见 vb6/src/spline3.bas 中的子例程 BuildAkimaSpline)
http://www.alglib.net/translator/re/alglib-2.6。 0.vb6.zip
http://www .koders.com/cpp/fid1393B9D668316C1700966643DE0609660B9CB13A.aspx?s=%22Brian+Smith%22
Repost and expansion on my answer to another SO question that was closed as a duplicate of this question - as suggested by a comment on that question.
Akima's original paper:
``A new method of interpolation and smooth curve fitting based on local procedures'', Journal of ACM 17, 4 (1970), 589-602
http://www.leg.ufpr.br/lib/exe/fetch.php/wiki:internas:biblioteca:akima.pdf
C implementation
https://github.com/ampl/gsl/blob/master/interpolation/akima.c
C# implementation
https://gist.github.com/dreikanter/3526685
Delphi implementation (see procedure BuildAkimaSpline in delphi/src/spline3.pas)
http://www.alglib.net/translator/re/alglib-2.6.0.delphi.zip
Akima's Fortran 66 implementation
http://cran.r-project.org/web/packages/akima/
Fortran 90 implementation
http://miyoshi.googlecode.com/svn-history/r72/trunk/common/common.f90
Java implementation
https://commons.apache.org/proper/commons-math/jacoco/org.apache.commons.math3.analysis.interpolation/AkimaSplineInterpolator.java.html
Lisp implementation "for AutoCAD 2d-Polylines"
http://autocad.xarch.at/code/candido/akima.lsp
Matlab implementation
http://www.mathworks.se/matlabcentral/fileexchange/1814-akima-interpolation
Pascal implementation (program description)
http://jean-pierre.moreau.pagesperso-orange.fr/Pascal/akima_pas.txt
Python implementation
http://www.lfd.uci.edu/~gohlke/code/akima.py.html
VB6 implementation (see subroutine BuildAkimaSpline in vb6/src/spline3.bas)
http://www.alglib.net/translator/re/alglib-2.6.0.vb6.zip
http://www.koders.com/cpp/fid1393B9D668316C1700966643DE0609660B9CB13A.aspx?s=%22Brian+Smith%22
获得了一些点击在谷歌代码搜索上,但这不是我不太了解的领域。第一个结果是针对 Math.NET 的,可能会引起一些兴趣。
Got some hits on google code search but this isn't an area I know much about. The first result is for Math.NET which may be of some interest.