/* nag_complex_lu_solve_mult_rhs(f04akc) Example Program * * Copyright 1990 Numerical Algorithms Group. * * Mark 1A revised, (Oct 1990). */ #include #include #include #include #include #define NMAX 5 #define TDA NMAX #define TDB NMAX int main(void) { Complex det; Complex a[NMAX][TDA], b[NMAX][TDB]; Integer i, j, n, dete, nrhs = 1; Integer pivot[NMAX]; static NagError fail; fail.print = TRUE; Vprintf("f04akc Example Program Results\n"); Vscanf("%*[^\n]"); /* Skip heading in data file */ Vscanf("%ld",&n); if (n > 0 && n <= NMAX) { for (i = 0; i < n; i++) for (j = 0; j < n; j++) Vscanf(" ( %lf , %lf ) ", &a[i][j].re, &a[i][j].im); for (i = 0; i < n; i++) for (j = 0; j < nrhs; j++) Vscanf(" ( %lf , %lf ) ", &b[i][j].re, &b[i][j].im); f03ahc(n, &a[0][0], (Integer)TDA, pivot, &det, &dete, &fail); if (fail.code!=NE_NOERROR) return EXIT_FAILURE; else { f04akc(n, nrhs, &a[0][0], (Integer)TDA, pivot, &b[0][0], (Integer)TDB, &fail); if (fail.code!=NE_NOERROR) return EXIT_FAILURE; Vprintf("Solution\n"); for (i=0; i