/* nag_running_median_smoother (g10cac) Example Program. * * Copyright 1992 Numerical Algorithms Group. * * Mark 3, 1992. * Mark 8 revised, 2004. */ #include #include #include #include int main(void) { Integer exit_status=0, i, isel, n; NagError fail; Nag_Smooth_Type smoother; double *rough=0, *smooth=0, *y=0; INIT_FAIL(fail); Vprintf("nag_running_median_smoother (g10cac) Example Program Results\n"); /* Skip heading in data file */ Vscanf("%*[^\n]"); Vscanf("%ld", &n); if (n>=1) { if ( !( rough = NAG_ALLOC(n, double)) || !( smooth = NAG_ALLOC(n, double)) || !( y = NAG_ALLOC(n, double)) ) { Vprintf("Allocation failure\n"); exit_status = -1; goto END; } } else { Vprintf("Invalid n.\n"); exit_status = 1; return exit_status; } for (i=0; i