/* nag_fft_complex (c06ecc) 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 *x=0, *xx=0, *y=0, *yy=0; INIT_FAIL(fail); Vprintf("nag_fft_complex (c06ecc) Example Program Results\n"); /* Skip heading in data file */ Vscanf("%*[^\n]"); while (scanf("%ld", &n)!=EOF) { if (n>1) { if ( !( x = NAG_ALLOC(n, double)) || !( y = NAG_ALLOC(n, double)) || !( xx = NAG_ALLOC(n, double)) || !( yy = 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