public inbox for gsl-discuss@sourceware.org
 help / color / mirror / Atom feed
From: "R. Sean Bowman" <sean@rootnode.com>
To: gsl-discuss@sources.redhat.com
Subject: gsl_cspline_init bug?
Date: Tue, 05 Nov 2002 23:11:00 -0000	[thread overview]
Message-ID: <20021105204213.H10500-200000@exigence.rootnode.com> (raw)

[-- Attachment #1: Type: TEXT/PLAIN, Size: 529 bytes --]

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


[-- Attachment #2: Type: TEXT/PLAIN, Size: 577 bytes --]

#include <stdlib.h>
#include <math.h>
#include <gsl/gsl_errno.h>
#include <gsl/gsl_spline.h> 


#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;
}

             reply	other threads:[~2002-11-06  2:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-05 23:11 R. Sean Bowman [this message]
2002-11-06  7:36 ` Kenneth Geisshirt
2002-11-06 16:05 ` Gerard Jungman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021105204213.H10500-200000@exigence.rootnode.com \
    --to=sean@rootnode.com \
    --cc=gsl-discuss@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).