/* nag_real_cholesky_skyline_solve (f04mcc) Example Program. * * Copyright 1996 Numerical Algorithms Group. * * Mark 4, 1996. * Mark 8 revised, 2004. */ #include #include #include #include #include #include #define B(I,J) b[(I)*tdb + J] #define X(I,J) x[(I)*tdx + J] int main(void) { Integer exit_status=0, i, k, k1, k2, lal, n, nrhs, *row=0, tdb, tdx; NagError fail; Nag_SolveSystem select; double *a=0, *al=0, *b=0, *d=0, *x=0; INIT_FAIL(fail); Vprintf("nag_real_cholesky_skyline_solve (f04mcc) Example Program Results\n"); /* Skip heading in data file */ Vscanf("%*[^\n]"); Vscanf("%ld",&n); if (n>=1) { if ( !( row = NAG_ALLOC(n, Integer)) ) { Vprintf("Allocation failure\n"); exit_status = -1; goto END; } } else { Vprintf("Invalid n.\n"); exit_status = 1; return exit_status; } lal=0; for (i=0; i=1) { if ( !( b = NAG_ALLOC(n*nrhs, double)) || !( d = NAG_ALLOC(n, double)) || !( x = NAG_ALLOC(n*nrhs, double)) ) { Vprintf("Allocation failure\n"); exit_status = -1; goto END; } tdb = nrhs; tdx = nrhs; } else { Vprintf("Invalid nrhs.\n"); exit_status = 1; return exit_status; } for (i=0; i