help-gsl
[Top][All Lists]
Advanced

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

[Help-gsl] Unhandled exception


From: D . Fornasier
Subject: [Help-gsl] Unhandled exception
Date: Wed, 22 Feb 2006 16:25:18 +0100

Hi,
I tried to use a sample code from the documentation (about splines)

I run it but it explodes, saying "Unhandled exception".
In practice, the instruction  gsl_spline_alloc fails.


Here attached is the code.

Any help is appreciated.

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <gsl/gsl_errno.h>
#include <gsl/gsl_spline.h>
int
main (void)
{
int i;
double xi, yi, x[10], y[10];
printf ("#m=0,S=2\n");
for (i = 0; i < 10; i++)
{
x[i] = i + 0.5 * sin (i);
y[i] = i + cos (i * i);
printf ("%g %g\n", x[i], y[i]);
}
printf ("#m=1,S=0\n");
{
gsl_interp_accel *acc
= gsl_interp_accel_alloc ();
gsl_spline *spline
= gsl_spline_alloc (gsl_interp_cspline, 10);
gsl_spline_init (spline, x, y, 10);
for (xi = x[0]; xi < x[9]; xi += 0.01)
{
yi = gsl_spline_eval (spline, xi, acc);
printf ("%g %g\n", xi, yi);
}
gsl_spline_free (spline);
gsl_interp_accel_free (acc);
}
return 0;
}


__________________________
Ing. Daniele Fornasier
Software Engineer
Tecnogamma spa
Vicolo Ongarie, 13
31050 Badoere di Morgano (TV)
tel. 0039 0422839232
address@hidden


reply via email to

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