ejml
ejml copied to clipboard
ZDRM: Support for Eigenvalue Decomposition
How do I get complex eigen values and vectors, like MatLab creates?
I tried using SimpleMatrix, but it assumes the matrix is either double or float. Can this be fixed, quickly? Or can you recommend another library? (jblas also doesn't have this) thx...
getEigen(int n, ZMatrixRMaj hamiltonian) { SimpleMatrix s = new SimpleMatrix(hamiltonian); eigens = s.eig();
java.lang.ClassCastException: org.ejml.data.ZMatrixRMaj cannot be cast to org.ejml.data.FMatrixRMaj
org.ejml.dense.row.decomposition.eig.SwitchingEigenDecomposition_FDRM.decompose(SwitchingEigenDecomposition_FDRM.java:36)
at org.ejml.simple.SimpleEVD.
Unfortunately Eigenvalue Decomposition is not fully implemented yet for complex matrices. I did update the code so that it gives a slightly more informative error message.
It's very rare that I need to mess with complex matrices so I'm not sure what others might support it. I believe the C++ library Eigen supports it, so maybe check JEigen?