/* nag_complex_svd(f02xec) Example Program * * Copyright 1990 Numerical Algorithms Group. * * Mark 1, 1990. */ #include #include #include #include #define COMPLEX(A) A.re, A.im #define COMPLEX_CONJ(A) A.re, -A.im #define EX1_MMAX 20 #define EX1_NMAX 10 #define EX2_MMAX 10 #define EX2_NMAX 20 static void ex1(void), ex2(void); int main(void) { Vprintf("f02xec Example Program Results\n"); Vscanf(" %*[^\n]"); /* Skip heading in data file */ ex1(); ex2(); return EXIT_SUCCESS; } static void ex1(void) { Integer tda = EX1_NMAX; Integer tdph = EX1_NMAX; Complex a[EX1_MMAX][EX1_NMAX], b[EX1_MMAX], ph[EX1_NMAX][EX1_NMAX], dummy[1]; double e[EX1_NMAX-1], sv[EX1_NMAX]; Integer i, j, m, n, iter, failinfo; Boolean wantp, wantq; static NagError fail; Vprintf("Example 1\n\n"); Vscanf(" %*[^\n]"); /* Skip heading in data file */ if (scanf("%ld%ld", &m, &n) != EOF) { if (m > EX1_MMAX || n > EX1_NMAX) { Vprintf("m or n is out of range.\n"); Vprintf("m = %2ld, n = %2ld\n", m, n); } else { for (i=0; i EX1_MMAX || n > EX1_NMAX) { Vprintf("m or n is out of range.\n"); Vprintf("m = %2ld, n = %2ld\n", m, n); } else { for (i=0; i