Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 885
dmon Avatar asked Nov 14 '22 02:11

dmon


1 Answers

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.

  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. See the docs for the advanced Mat constructors.

  3. Slightly modify the existing code by using memory/arrays allocated by Armadillo. The pointer to the memory used by Armadillo matrices and vectors can be easily obtained via the .memptr() function.

Choice 3 is probably the easiest for interfacing with existing code.

like image 158
mtall Avatar answered Dec 21 '22 03:12

mtall