//A = U*S*Vt
        //A*At = U*S^2*Ut
        //At*A = V*S^2*Vt
        //A*At = (At*A)t
        //This method is not right
        public static void FactorSVD_LDLt(MMatrix A)
        {
            MMatrix AA = new MMatrix();
            MMatrix Eigenvectors = new MMatrix();
            Vector Eigenvalues = new Vector();
            int index = A.row;
            if (A.row > A.col)
                index = A.col;

            AA = A * A.Transpose();
            AA.FactorLDLt();
            Eigenvectors = new MMatrix(AA.LDL_L);
            Eigenvalues = new Vector(AA.row);
            for (int i = 0; i < index; ++i)
                Eigenvalues[i] = AA.LDL_D[i, i];
            SortEigen(ref Eigenvalues, ref Eigenvectors);
            A.SVD_U = Eigenvectors.MArray;

            if (A.SVD_S == null)
                A.SVD_S = new double[A.row, A.col];
            for (int i = 0; i < index; ++i)
                A.SVD_S[i, i] = Math.Sqrt(Eigenvalues[i]);

            AA = AA.Transpose();
            AA.FactorLDLt();
            Eigenvectors = new MMatrix(AA.LDL_L);
            Eigenvalues = new Vector(AA.row);
            for (int i = 0; i < index; ++i)
                Eigenvalues[i] = AA.LDL_D[i, i];
            SortEigen(ref Eigenvalues, ref Eigenvectors);
            A.SVD_Vt = Eigenvectors.Transpose().MArray;
        }