The GeneralizedEigen type is not really a factorization right now. From F=eigfact(A,B) you cannot recreate A and B. There are an easy problem and a hard problem here.
[ ] First of all, we'll need to save the left eigenvectors in the factorization type. Right now, only the right vectors are stored. The right vectors are enough in the normal eigen factorization because for F=eigfact(A) then A==F[:vectors]*Diagonal(F[:values])/F[:vectors] where F[:vectors] are the usual right eigenvectors.
[ ] The second problem is harder. I think LAPACK is destroying the result of the factorization by nomalizing the eigenvectors. Normalization doesn't cause problems in the usual eigen problem, but for the generalized problem we would need that diag(F[:leftvectors]'A*F[:rightvectors])==alpha and diag(F[:leftvectors]'B*F[:rightvectors])==beta where alpha and beta are the values returned from the LAPACK function xGGEV such that alpha./beta are the generalized eigenvalues.
The first box can just be fixed, but the second would either require a change to LAPACK or that we calculate the eigenvectors in Julia based on the generalized Schur factorization. That is not really hard, but some care is needed for the cases there eigenvalues are almost or exactly identical.
The
GeneralizedEigen
type is not really a factorization right now. FromF=eigfact(A,B)
you cannot recreateA
andB
. There are an easy problem and a hard problem here.F=eigfact(A)
thenA==F[:vectors]*Diagonal(F[:values])/F[:vectors]
whereF[:vectors]
are the usual right eigenvectors.diag(F[:leftvectors]'A*F[:rightvectors])==alpha
anddiag(F[:leftvectors]'B*F[:rightvectors])==beta
wherealpha
andbeta
are the values returned from the LAPACK functionxGGEV
such thatalpha./beta
are the generalized eigenvalues.The first box can just be fixed, but the second would either require a change to LAPACK or that we calculate the eigenvectors in Julia based on the generalized Schur factorization. That is not really hard, but some care is needed for the cases there eigenvalues are almost or exactly identical.