/* nag_1d_spline_intg (e02bdc) Example Program. * * Copyright 1991 Numerical Algorithms Group. * * Mark 2, 1991. * Mark 8 revised, 2004. */ #include #include #include #include int main(void) { Integer exit_status=0, j; NagError fail; Nag_Spline spline; double integral; INIT_FAIL(fail); Vprintf("nag_1d_spline_intg (e02bdc) Example Program Results\n"); Vscanf("%*[^\n]"); /* Skip heading in data file */ while(scanf("%ld",&(spline.n)) != EOF) { if (spline.n>0) { if ( !(spline.c = NAG_ALLOC(spline.n, double)) || !(spline.lamda = NAG_ALLOC(spline.n, double)) ) { Vprintf("Storage allocation failed. Reduce the " "size of spline.n\n"); exit_status = 1; goto END; } } else { Vprintf("spline.n is out of range : spline.n = %ld\n", spline.n); exit_status = 1; goto END; } for (j=0; j