ejml icon indicating copy to clipboard operation
ejml copied to clipboard

ZDRM: Support for Eigenvalue Decomposition

Open rstrauss-logyx opened this issue 4 years ago • 2 comments

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.(SimpleEVD.java:56) at org.ejml.simple.SimpleBase.eig(SimpleBase.java:949)

rstrauss-logyx avatar Oct 03 '20 00:10 rstrauss-logyx

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?

lessthanoptimal avatar Oct 04 '20 02:10 lessthanoptimal