/* Copyright (C) 1986 Adam Fritz, 133 Main St., Afton, N.Y. 13730 */ #include "stdio.h" /* PR globals */ #define ldx 10 /* dimension upper bound */ #define Iterxx 100 /* iterations upper bound */ int lda ; /* maximum dimension */ int n ; /* dimension */ float A[ldx][ldx] ; /* original */ float B[ldx][ldx] ; /* inverse */ float R[ldx][ldx] ; /* residuals */ float X[ldx][ldx] ; /* working */ int Iterx ; /* maximum iterations */ float Residx ; /* convergence criterion */ #include "Hilgen.c" /* Test Matrix generator */ /*#include "Rangen.c" /* Test Matix Generator */ */ #include "PR.c" /* Pan-Reif */ #include "BLAS.c" /* Basic Linear Algebra */ #include "OUT.c" /* SICE Output Routine */ #include "Abs.c" main () /* Program: */ /* */ /* Pan-Reif Test Driver. */ /* */ /* Version: Date: */ /* */ /* Eco-C 1.1 04/25/86 */ /* */ /* Description: */ /* */ /* Author: */ /* */ /* Adam Fritz */ /* 133 Main Street */ /* Afton, New York 13730 */ { int i, j ; float SDOT(), SASUM() ; /* Initialize */ lda = ldx ; /* Announcement */ printf("Pan-Reif Test Program.\n") ; /* Get Dimension */ n = 0 ; while ((n < 1) || (n > lda)) { printf("Dimension: ") ; Š scanf("%d", &n) ; } /* Get Iterations */ Iterx = 0 ; while ((Iterx < 1) || (Iterx > Iterxx)) { printf("Iterations: ") ; scanf("%d", &Iterx) ; } /* Get Convergence Criterion */ Residx = 0.0 ; while (Residx <= 0.0) { printf("Residual: ") ; scanf("%f", &Residx) ; } /* Generate Test Matrix */ MATGEN(A, lda, n) ; printf("\n") ; printf("Original System (by column):\n") ; printf("\n") ; OUT(A, lda, n, n) ; /* Compute Determinant and Inverse */ PR() ; printf("Iterations: %d\n", Iterx) ; printf("\n") ; printf("Inverse (by column):\n") ; printf("\n") ; OUT(B, lda, n, n) ; /* Display Residuals */ printf("Residuals: (by column):\n") ; printf("\n") ; OUT(R, lda, n, n) ; /* Done */ printf("End of Test.\n") ; } /* Copyright (C) 1986 Adam Fritz, 133 Main St., Afton, N.Y. 13730 */