forum.alglib.net

ALGLIB forum
It is currently Fri Apr 19, 2024 6:13 am

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Completely stuck with spline1d
PostPosted: Wed Nov 26, 2014 3:59 pm 
Offline

Joined: Wed Nov 26, 2014 3:51 pm
Posts: 2
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!


Top
 Profile  
 
 Post subject: Re: Completely stuck with spline1d
PostPosted: Thu Nov 27, 2014 8:37 am 
Offline

Joined: Wed Nov 26, 2014 3:51 pm
Posts: 2
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 56 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group