forum.alglib.net
http://forum.alglib.net/

Completely stuck with spline1d
http://forum.alglib.net/viewtopic.php?f=2&t=2183
Page 1 of 1

Author:  technorabble [ Wed Nov 26, 2014 3:59 pm ]
Post subject:  Completely stuck with spline1d

Hi

Thanks for this library - it looks like exactly what I need, but I have to confess, I'm completely stuck trying to get it working.

I have an std::map<double x, double y> "MyValues" with contents a bit like this:
x y
10, 34
15, 37
30, 35
45, 33
60, 30
...
..
.
222, 1
245, 0
etc

X is unique.

And I'm hoping that spline1d is the right tool to interpolate smoothly between the points while ensuring that queries for points where data has been provided return exactly the data from the map. I will also need to get values for x=0 to x=10, and x=245 to x=255.

I've tried implementing some sample code I've found here and there, but nothing seems quite right.

Hopefully this is quite a simple case - can anyone prove a bit of sample code I can work from?

Thanks!

Author:  technorabble [ Thu Nov 27, 2014 8:37 am ]
Post subject:  Re: Completely stuck with spline1d

I've been hacking away at this, and I think I'm getting there with:

Code:
real_1d_array x = "[0,1,2,3,4]";
real_1d_array y = "[0.0,1.0,4.0,9.0,16.0]";
spline1dinterpolant spline;
spline1dbuildcubic(x, y, spline);


So all that remains is getting numbers out, which I'll figure out and post here when I've got it working.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/