This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Bug in interpolation/akima.c.


Toby White wrote:
> 
> The offending part is at line 161; inside the loop
> 
>    for (i = 0; i < interp->size; i++)
>      {
>       ...
>       double h_i = x_array[i + 1] - x_array[i];
>       ...
>       }
> 
> However, x_array is generally going to be of length interp->size,
> with obvious consequences on the last loop iteration.

Yup. This was not the only off-by-1 error in akima either.
I think I have fixed them all now. Akima was never really tested
(there were no explicit tests written for it); I added
a rudimentary test for it, similar to the other tests.

We still need more tests in that directory.


I just checked the fixes in.

Thanks.

-- 
G. Jungman

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]