// Csimeq.java Csolve simultaneous equations AX=Y all Complex // needs Complex.java compiled // Csolve complex linear equations for X where A * X = Y // method: Gauss-Jordan elimination using maximum pivot // usage: Csimeq(A[][],Y,X); or Csimeq(n,A[],Y,X) // usage: Csimeq(n,B[],X); or Csimeq(n,B[][],X) B = AY // Translated to java by : Jon Squire , 26 March 2003 // First written by Jon Squire December 1959 for IBM 650, translated to // other languages e.g. Fortran converted to Ada converted to C // then converted to java then to Complex public class Csimeq { Complex Czero = new Complex(0.0,0.0); Csimeq(final Complex A[][], final Complex Y[], Complex X[]) { int n=A.length; Complex B[][] = new Complex[n][n+1]; // working matrix if(A[0].length!=n || Y.length!=n || X.length!=n) { System.out.println("Error in Csimeq, inconsistent array sizes."); } // build working data structure for(int i=0; i abs_pivot) { I_pivot = i; pivot = B[row[i]][k]; abs_pivot = pivot.abs(); } } // have pivot, interchange row indicies hold = row[k]; row[k] = row[I_pivot]; row[I_pivot] = hold; // check for near singular if(abs_pivot < 1.0E-20) { for(int j=k+1; j