/* nag_convolution_real (c06ekc) Example Program. * * Copyright 1990 Numerical Algorithms Group. * * Mark 1, 1990. * Mark 8 revised, 2004. */ #include #include #include #include int main(void) { Integer exit_status=0, j, n; NagError fail; double *xa=0, *xb=0, *ya=0, *yb=0; INIT_FAIL(fail); Vprintf("nag_convolution_real (c06ekc) Example Program Results\n"); /* Skip heading in data file */ Vscanf("%*[^\n]"); while (scanf("%ld", &n)!=EOF) { if (n>1) { if ( !( xa = NAG_ALLOC(n, double)) || !( xb = NAG_ALLOC(n, double)) || !( ya = NAG_ALLOC(n, double)) || !( yb = 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 (j = 0; j