[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-gsl] cspline: gsl_spline_eval

From: Alex
Subject: [Help-gsl] cspline: gsl_spline_eval
Date: Tue, 6 Dec 2011 19:04:16 +0100

Hi, i upgraded from openSuse 11.3 to 12.1 and got a new gsl version. I have 
this piece of code which worked fine befor:

    int pointsNumber = _points.size();
    double* x = new double [pointsNumber];
    double* y = new double [pointsNumber];
    int i = 0;
    foreach(QPointF point, _points)
      x[i] = point.x();
      y[i] = point.y();
    gsl_interp_accel *acc = gsl_interp_accel_alloc ();
    gsl_spline *spline = gsl_spline_alloc (gsl_interp_cspline, pointsNumber);
    gsl_spline_init (spline, x, y, pointsNumber);
    for(int i = 0;  i < _data.size(); ++i)
      _data[i].setValue(_yaxistyp, gsl_spline_eval (spline, 
_data[i].getValue(_xaxistyp), acc));

But now i'm getting always error messages "interp.c:150: ERROR: interpolation 
error". I think it's because i want y values for x
values lower/bigger than the x values in my interpolation points. How can i get 
these values? I don't want to add additional
interpolation points because that will change my spline.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]