@@ -0,0 +1,784 @@
+public class SVD1%7B%0A%09public ComplexMatrix original;%0A%09public ComplexMatrix U,V,S;%0A%09%0A%09public SVD1(ComplexMatrix A)%7B%0A%09%09original = A;%0A%09%09boolean transpose = false;%0A%09%09if(A.rows%3CA.col)%7B%0A%09%09%09A = A.transpose();%0A%09%09%09transpose = true;%0A%09%09%7D%0A%09%09Eigen eigen = new Eigen(A.mult(A.conjugateTranspose()));%0A%09%09U = eigen.getVectors();%0A%09%09S = eigen.diagonal().partition(1,1,A.rows,A.col);%0A%09%09for(int i=1; i%3C=A.col; i++)%0A%09%09%09S.set(i,i,S.get(i,i).sqrt());%0A%09%09V = U.conjugateTranspose().mult(A).partition(1,1,A.col,A.col);%0A%09%09for(int i=1; i%3C=A.col; i++)%7B%0A%09%09%09for(int j=1; j%3C=A.col; j++)%7B%0A%09%09%09%09V.set(i,j,V.get(i,j).divideBy(S.get(i,i)));%0A%09%09%09%7D%0A%09%09%7D%0A%09%09System.out.println(U);%0A%09%09System.out.println(S);%0A%09%09System.out.println(V);%0A%09%09System.out.println(U.mult(S).mult(V.conjugateTranspose()).sub(A));%0A%09%09System.out.println(A);%0A%09%7D%0A%7D%0A

Create SVD1.java