| Thread Closed |
Solving newton interpolation with c |
Share Thread | Thread Tools |
| Nov14-07, 01:38 PM | #1 |
|
|
Solving newton interpolation with c
Hi,
i have no idea how to start up my program on newton interpolation. i have solved it manually but im clueless on how 2 start my program. below represnts the input which i want 2 solve. every 4 lines represnts one problem. the 1st line- n,m where n is no of data points and m is no of evaluation pts. 2nd and 3rd line represent x and y of n pts. 4th line is m @ which it is to be evaluated. the function is sinx. can anyone help me out?? 3 2 0.1 0.4 0.5 3.1 3.2 4.1 1.5 1.6 3 5 1.0 2.0 3.0 1.7 1.8 1.1 1.1 1.2 1.4 1.3 1.8 15 5 0.1 0.4 0.5 1.2 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 2.95 3.1 3.2 4.1 2.7 1.9 1.7 1.8 1.1 1.7 1.8 1.1 1.7 1.8 1.1 2.3 1.0 1.2 1.6 2.0 2.5 ma output is supposed to be in d form e1 fN(e1) e2 fN(e2) . . em fN(em) |
| Nov14-07, 01:40 PM | #2 |
|
|
e1, e2 and em represent the fourth line of each problem
|
| Nov14-07, 02:14 PM | #3 |
|
Recognitions:
|
Numerical recipes ( http://www.nr.com/ ) is the classic book on doing this sort of thing.
The code is available online for free. The book is sometimes available depending on what they feel like that day. You can usually pick up the older editions of the Fortran/Pascal or C versions cheaply. |
| Nov14-07, 03:37 PM | #4 |
|
|
Solving newton interpolation with c
|
| Nov14-07, 03:45 PM | #5 |
|
Recognitions:
|
It's not there anymore, sometimes you can read the whole book online, sometimes you can download the code - they are an amazing bunch.
The licence for the code used to say something like - "you can't copy this code from the disk, you can type it out of the book but you can't change anything. We own the copyright on the algorithms - you can't use the algorithms and change the code." There was a bunch of lecturers who boycotted the book and lobbyed CUP to stop publishing it. It would be a bit embarrasing when CUP would have to sue the Cambridge University Library. |
| Nov14-07, 04:38 PM | #6 |
|
|
Yeah. It was noted in an ACCU review of the 2nd edition C version that one can't even typed the code into one's own computer if you didn't own the book. i.e. you got it out of the library / workplace etc.
The 2nd edition C version said: |
| Nov14-07, 05:04 PM | #7 |
|
Recognitions:
|
And worst of all they have the C arrays start from 1 (or they do in my 1988 'C' edition)
|
| Nov15-07, 06:38 AM | #8 |
|
|
There were some weird C compilers back in early DOS days that used something called an option-base setting, defined in a header file: 0 = normal C; 1= arrays start at 1 like BASIC. I dunno why.
Since everything in Numerical Recipes is available thru the GNU Scientific library, just pitch the damn thing. GSL is free. |
| Nov15-07, 08:26 AM | #9 |
|
Recognitions:
|
I think my 'C' edition was a too close copy of the Fortran one.
The explanations of the algorithms are still quite good. Even if you are going to use NAG or GSL it's a good first place to look for which algorithm you should use and what the problems might be. |
| Thread Closed |
| Thread Tools | |
Similar Threads for: Solving newton interpolation with c
|
||||
| Thread | Forum | Replies | ||
| Lagrange Interpolation | Programming & Comp Sci | 14 | ||
| Interpolation of L^p Spaces | Calculus & Beyond Homework | 21 | ||
| Interpolation | Calculus & Beyond Homework | 1 | ||
| Linear Interpolation | Differential Geometry | 0 | ||
| interpolation forumula | General Math | 2 | ||