I would like to do a Generalized Schur (or QZ) decomposition for a pair of complex matrices $A$ and $B$.

I found the following class:

class Eigen::GeneralizedEigenSolver<_MatrixType>

but it seems that it only works for real matrices. Any ideas?

  • $\begingroup$ Are you asking for alternative software packages, or whether Eigen can do that? $\endgroup$ Commented Feb 21, 2018 at 1:12
  • $\begingroup$ Can Eigen do that? $\endgroup$
    – RangerBob
    Commented Feb 21, 2018 at 6:58
  • $\begingroup$ I have no idea. I'm asking what exactly you are asking in your original question. $\endgroup$ Commented Feb 21, 2018 at 7:46
  • $\begingroup$ Do you know alternative software packages? $\endgroup$
    – RangerBob
    Commented Feb 21, 2018 at 20:22
  • $\begingroup$ No, I don't, actually. It's not my field :-) $\endgroup$ Commented Feb 22, 2018 at 23:24

1 Answer 1


Numerical computation of Generalized Complex Schur decomposition can be performed by calling zgges() LAPACK function. For example, see NETLIB zgees documentation, or a documentation for any other BLAS/LAPACK library implementation.

Eigen is technically nothing else, but a very convenient templated library of wrappers and algorithms, also including some custom implementation. However, for maximum Eigen performance, it is recommended to link it to a LAPACK\BLAS library, for example, Intel MKL.

Now, regarding Schur decomposition in Eigen. I have not used the functionality from GeneralizedEigenSolver, but according to the documentation, only real matrices are supported. The following code compiles correctly:

Eigen::GeneralizedEigenSolver<Eigen::MatrixXf> solver;
Eigen::MatrixXf A(4,4),B(4,4);

However, the complex version results in a compilation error that pretty much describes itself: no support for complex matrices yet:

Eigen::GeneralizedEigenSolver<Eigen::MatrixXcd> solver;
Eigen::MatrixXcd A(4,4),B(4,4);

Eigen/src/Eigenvalues/GeneralizedEigenSolver.h:367:20: error: no viable conversion from 'CoeffReturnType' (aka 'const std::__1::complex<double>') to 'RealScalar' (aka 'double')

The example is tested on Eigen 3.3.4. So, I would suggest you to use LAPACK function directly (you have to have some BLAS\LAPACK library connected to your code) without using Eigen wrappers for now.


Not the answer you're looking for? Browse other questions tagged or ask your own question.