/* nag_trans_hessenberg_controller (g13exc) Example Program. * * Copyright 1993 Numerical Algorithms Group * * Mark 3, 1993 * Mark 8 revised, 2004. */ #include #include #include #include #define A(I,J) a[(I)*tda + J] #define B(I,J) b[(I)*tdb + J] #define U(I,J) u[(I)*tdu + J] int main(void) { Integer exit_status=0, i, j, m, n, tda, tdb, tdu; NagError fail; Nag_ControllerForm reduceto; double *a=0, *b=0, one=1.0, *u=0, zero=0.0; INIT_FAIL(fail); Vprintf("nag_trans_hessenberg_controller (g13exc) Example Program Results\n"); /* Skip the heading in the data file and read the data. */ Vscanf("%*[^\n]"); Vscanf("%ld%ld",&n,&m); if (n>=1 || m>=1) { if ( !( a = NAG_ALLOC(n*n, double)) || !( b = NAG_ALLOC(n*m, double)) || !( u = NAG_ALLOC(n*n, double)) ) { Vprintf("Allocation failure\n"); exit_status = -1; goto END; } tda = n; tdb = m; tdu = n; } else { Vprintf("Invalid n or m.\n"); exit_status = 1; return exit_status; } reduceto = Nag_UH_Controller; for (j=0; j