21 assert(A->rows() == A->cols());
22 assert(A->cols() == B->rows());
23 assert(B->rows() == B->cols());
26 assert(alpha!=
nullptr); alpha->set_size(n); alpha->fill(0);
27 assert(beta!=
nullptr); beta ->set_size(n); beta ->fill(0);
28 assert(L!=
nullptr); L ->set_size(n, n); L ->fill(0);
29 assert(R!=
nullptr); R ->set_size(n, n); R ->fill(0);
32 long lwork = 1000 + (8*n + 16);
33 auto *work =
new std::complex<double>[lwork];
34 auto *rwork =
new double[2*n + 1];
35 auto *bwork =
new v3p_netlib_logical[n + 1];
37 A->inplace_transpose();
38 B->inplace_transpose();
39 v3p_netlib_zgges_ (
"V",
"V",
53 A->inplace_transpose();
54 B->inplace_transpose();
55 L->inplace_transpose();
56 R->inplace_transpose();
81 std::cerr << __FILE__
": info = " << info <<
", something went wrong:\n";
83 std::cerr << __FILE__
": (internal error) the " << (-info) <<
"th argument had an illegal value\n";
85 else if (1 <= info && info <= n) {
86 std::cerr << __FILE__
": the QZ iteration failed, but the last " << (n - info) <<
" eigenvalues may be correct\n";
88 else if (info == n+1) {
89 std::cerr << __FILE__
": something went wrong in ZHGEQZ\n";
91 else if (info == n+2) {
92 std::cerr << __FILE__
": roundoff error -- maybe due to poor scaling\n";
94 else if (info == n+3) {
95 std::cerr << __FILE__
": reordering failed in ZTGSEN\n";
98 std::cerr << __FILE__
": unknown error\n";
An ordinary mathematical matrix.
Declare in a central place the list of symbols from netlib.
Solves the generalized eigenproblem det(t A - s B) = 0.
Mathematical vector class, templated by type of element.
bool vnl_generalized_schur(vnl_matrix< std::complex< double > > *A, vnl_matrix< std::complex< double > > *B, vnl_vector< std::complex< double > > *alpha, vnl_vector< std::complex< double > > *beta, vnl_matrix< std::complex< double > > *L, vnl_matrix< std::complex< double > > *R)