- Matrix origmat = new Matrix(in, n, n);
-
- // System.out.println(" --- Original matrix ---- ");
- // / origmat.print(System.out);
- // System.out.println();
- // System.out.println(" --- transpose matrix ---- ");
- Matrix trans = origmat.transpose();
-
- // trans.print(System.out);
- // System.out.println();
- // System.out.println(" --- OrigT * Orig ---- ");
- Matrix symm = trans.postMultiply(origmat);
-
- // symm.print(System.out);
- // System.out.println();
- // Copy the symmetric matrix for later
- // Matrix origsymm = symm.copy();
-
- // This produces the tridiagonal transformation matrix
- // long tstart = System.currentTimeMillis();
- symm.tred();
-
- // long tend = System.currentTimeMillis();
-
- // System.out.println("Time take for tred = " + (tend-tstart) + "ms");
- // System.out.println(" ---Tridiag transform matrix ---");
- // symm.print(System.out);
- // System.out.println();
- // System.out.println(" --- D vector ---");
- // symm.printD(System.out);
- // System.out.println();
- // System.out.println(" --- E vector ---");
- // symm.printE(System.out);
- // System.out.println();
- // Now produce the diagonalization matrix
- // tstart = System.currentTimeMillis();
- symm.tqli();
- // tend = System.currentTimeMillis();
-
- // System.out.println("Time take for tqli = " + (tend-tstart) + " ms");
- // System.out.println(" --- New diagonalization matrix ---");
- // symm.print(System.out);
- // System.out.println();
- // System.out.println(" --- D vector ---");
- // symm.printD(System.out);
- // System.out.println();
- // System.out.println(" --- E vector ---");
- // symm.printE(System.out);
- // System.out.println();
- // System.out.println(" --- First eigenvector --- ");
- // double[] eigenv = symm.getColumn(0);
- // for (int i=0; i < eigenv.length;i++) {
- // Format.print(System.out,"%15.4f",eigenv[i]);
- // }
- // System.out.println();
- // double[] neigenv = origsymm.vectorPostMultiply(eigenv);
- // for (int i=0; i < neigenv.length;i++) {
- // Format.print(System.out,"%15.4f",neigenv[i]/symm.d[0]);
- // }
- // System.out.println();