This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: Bug in interpolation/akima.c.
- Subject: Re: Bug in interpolation/akima.c.
- From: Gerard Jungman <jungman at lanl dot gov>
- Date: Fri, 20 Oct 2000 14:11:41 -0600
- CC: gsl-discuss at sourceware dot cygnus dot com
- Organization: LANL T-8
- References: <20001020102854.A21268@bit.ch.cam.ac.uk>
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