简体   繁体   English

使用犰狳插值

[英]Interpolation using armadillo

So it appears as though armadillo does not have any interpolation capability (at least I can find no reference to it in the documentation). 所以看起来好像犰狳没有任何插值功能(至少我在文档中找不到它的引用)。 I was wondering if anyone has any suggestions on how best to implement spline and linear interpolation using rowvec's as input and output? 我想知道是否有人对如何使用rowvec作为输入和输出实现样条线性和线性插值有任何建议?

As you already have the source code for the interpolation algorithm, three possible choices come to mind: 由于您已经拥有插值算法的源代码,因此可以想到三种可能的选择:

  1. Refactor the code to directly use Armadillo classes (eg. matrices and vectors) instead of its own arrays. 重构代码以直接使用Armadillo类(例如矩阵和向量)而不是自己的数组。

  2. Use the code as is, and then set an instance of Armadillo's matrix or vector classes to use the memory of the arrays produced by the interpolation algorithm. 按原样使用代码,然后设置Armadillo矩阵或矢量类的实例,以使用插值算法生成的数组的内存。 See the docs for the advanced Mat constructors . 请参阅高级Mat构造函数的文档。

  3. Slightly modify the existing code by using memory/arrays allocated by Armadillo. 使用Armadillo分配的内存/数组稍微修改现有代码。 The pointer to the memory used by Armadillo matrices and vectors can be easily obtained via the .memptr() function. 可以通过.memptr()函数轻松获得指向Armadillo矩阵和向量所使用的内存的指针。

Choice 3 is probably the easiest for interfacing with existing code. 选择3可能是与现有代码接口最简单的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM