From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15016 invoked by alias); 6 Nov 2002 21:24:39 -0000 Mailing-List: contact gsl-discuss-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gsl-discuss-owner@sources.redhat.com Received: (qmail 14996 invoked from network); 6 Nov 2002 21:24:38 -0000 Received: from unknown (HELO bellerophon.lanl.gov) (128.165.59.112) by sources.redhat.com with SMTP; 6 Nov 2002 21:24:38 -0000 Received: from bellerophon.lanl.gov (IDENT:m3UipzrzAhJ/8h1K4lnG8QO17Mhp9Bf6@bellerophon.lanl.gov [127.0.0.1]) by bellerophon.lanl.gov (8.11.6/8.11.6) with ESMTP id gA6LVZn26283; Wed, 6 Nov 2002 14:31:35 -0700 Subject: Re: gsl_cspline_init bug? From: Gerard Jungman To: "R. Sean Bowman" Cc: gsl-discuss@sources.redhat.com In-Reply-To: <20021105204213.H10500-200000@exigence.rootnode.com> References: <20021105204213.H10500-200000@exigence.rootnode.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Wed, 06 Nov 2002 16:05:00 -0000 Message-Id: <1036618295.27322.25.camel@bellerophon.lanl.gov> Mime-Version: 1.0 X-SW-Source: 2002-q4/txt/msg00118.txt.bz2 Fixed in CVS. Thanks for the report. -- G. Jungman On Tue, 2002-11-05 at 19:42, R. Sean Bowman wrote: > hello > > I think I've found a bug in gsl_cspline_init. It appears to want a > minimum of two points, but in this case a variable "sys_size" gets set to > 0 in gsl_cspline_init, which somebody doesn't like later. I get the > message > > gsl: view_source.c:28: ERROR: vector length n must be positive integer > Default GSL error handler invoked. > Aborted > > Attached is a small program which elicits this behavior on my linux box. > > Isn't this a problem? Shouldn't csplines need more than two points to do > interpolation? > > Thanks a bunch! > Sean > > ---- > > #include > #include > #include > #include > > > #define PTS 2 > > int main (int argc, char** argv){ > int i; > double xi, yi, x[PTS], y[PTS]; > > for (i = 0; i < PTS; i++){ > x[i] = i + 0.5 * sin (i); > y[i] = i + cos (i * i); > } > > { > gsl_interp_accel *acc = gsl_interp_accel_alloc (); > gsl_spline *spline = gsl_spline_alloc (gsl_interp_cspline, PTS); > gsl_spline_init (spline, x, y, PTS); > > gsl_spline_free (spline); > gsl_interp_accel_free(acc); > } > > return 0; > }