public double[][] Eigenvectors(Matrix m) { EigenvalueDecomposition decomposition = m.eig(); Matrix eigenVectorsMatrix = decomposition.getV(); double[][] eigenvectors = eigenVectorsMatrix.getArray(); // System.out.println("eigenvectors matrix"); // eigenVectorsMatrix.print(2,2); return eigenvectors; }
public double[] Eigenvalues(Matrix m) { EigenvalueDecomposition decomposition = m.eig(); double[] eigenvalues = decomposition.getRealEigenvalues(); // System.out.println("eigenvalues: "); // for(int i=0;i<eigenvalues.length;i++) // System.out.println(""+eigenvalues[i]); return eigenvalues; }