// test_Cinvert.java needs Complex.java and Cinvert.java compiled public class test_Cinvert { double state = 30000000.0; // arbitrary initial value for undnrt Complex Czero = new Complex(0.0,0.0); Complex Cone = new Complex(1.0,0.0); test_Cinvert() { int n = 10; Complex A[][] = new Complex[n][n]; Complex Ac[][] = new Complex[n][n]; Complex Ai[][] = new Complex[n][n]; double err, maxerr=0.0; System.out.println("test_Cinvert.java running, n="+n); for(int i=0; imaxerr) maxerr=err; } // end j } // end i System.out.println("maxerr="+maxerr); System.out.println(" "); } // end test_Cinvert double udrnrt() // uniformly distributed random numbers 0.0 to 1.0 { double modulus = 2147483647.0; // 2**31-1 double multiplier = 16807.0; // prime to prime power // state must be global (static in C) double t; int i; t = state * multiplier; i = (int)(t / modulus); state = t - (i * modulus); if(state < 0.0) state = state + modulus; return state / modulus; } // end udrnrt public static void main(String[] args) { new test_Cinvert(); System.out.println("end test_Cinvert.java main"); } // end main of test_Cinvert.java } // end class test_Cinvert.java