/* nag_fft_real (c06eac) 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, n2, nj; NagError fail; double *a=0, *b=0, *x=0, *xx=0; INIT_FAIL(fail); Vprintf("nag_fft_real (c06eac) Example Program Results\n"); /* Skip heading in data file */ Vscanf("%*[^\n]"); while (scanf("%ld", &n)!=EOF) { if (n>1) { if ( !( a = NAG_ALLOC(n, double)) || !( b = NAG_ALLOC(n, double)) || !( x = NAG_ALLOC(n, double)) || !( xx = NAG_ALLOC(n, double)) ) { Vprintf("Allocation failure\n"); exit_status = -1; goto END; } } else { Vprintf("Invalid n.\n"); exit_status = 1; } for (j = 0; j