jblas-project / jblas

Linear Algebra for Java
http://jblas.org
BSD 3-Clause "New" or "Revised" License
590 stars 149 forks source link

Complex (Hermitian) eigenvalues/eigenvectors #105

Open imantdaunhawer opened 6 years ago

imantdaunhawer commented 6 years ago

Hi,

on request of a colleague I've added the computation of eigenvectors/eigenvalues of complex and complex hermitian matrices as native and convenience methods. For this I received some funding from the University of Konstanz (Germany). Now, I would like to share this work with you, to uncover potential mistakes and to make a small contribution to your project.

For the computation of eigenvalues/eigenvectors of complex matrices (Fortran routines CGEEV and ZGEEV) the native methods already existed, but I added convenience methods for calling them from the Eigen class. For this I overloaded the existing methods Eigen.eigenvalue and Eigen.eigenvector in a way that seems consistent with the current design. Further I've implemented basic tests to TestEigen.java to check my implementation.

For the computation of eigenvalues/eigenvectors of complex Hermitian matrices (Fortran routines CHEEV and ZHEEV) I added the native methods (through an addition to the Makefile which automatically generates the C code). Further, I created new convenience methods Eigen.hermitianEigenvaluesand Eigen.hermitianEigenvectors for which a call assumes a Hermitian input matrix (otherwise, the results might be incorrect). Again, I've included tests that cover some basic cases.

I'll be glad to receive feedback on this implementation and I even have a few days left to work on further functionality related to complex and Hermitian matrices (please let me know if there are any preferences from your side).