26 assert(alphar!=
nullptr); alphar->
set_size(n); alphar->
fill(0);
27 assert(alphai!=
nullptr); alphai->
set_size(n); alphai->
fill(0);
28 assert(beta!=
nullptr); beta ->
set_size(n); beta ->
fill(0);
33 long lwork = 1000 + (8*n + 16);
34 auto *work =
new double[lwork];
38 v3p_netlib_dgges_ (
"V",
"V",
79 std::cerr << __FILE__
": info = " << info <<
", something went wrong:\n";
81 std::cerr << __FILE__
": (internal error) the " << (-info) <<
"th argument had an illegal value\n";
83 else if (1 <= info && info <= n) {
84 std::cerr << __FILE__
": the QZ iteration failed, but the last " << (n - info) <<
" eigenvalues may be correct\n";
86 else if (info == n+1) {
87 std::cerr << __FILE__
": something went wrong in DHGEQZ\n";
89 else if (info == n+2) {
90 std::cerr << __FILE__
": roundoff error -- maybe due to poor scaling\n";
92 else if (info == n+3) {
93 std::cerr << __FILE__
": reordering failed in DTGSEN\n";
96 std::cerr << __FILE__
": unknown error\n";
unsigned int cols() const
Return the number of columns.
bool set_size(size_t n)
Resize to n elements.
T const * data_block() const
Access the contiguous block storing the elements in the vector. O(1).
vnl_matrix & inplace_transpose()
Transposes this matrix efficiently, and returns it.
Solves the generalized eigenproblem det(t A - s B) = 0.
Declare in a central place the list of symbols from netlib.
bool vnl_generalized_schur(vnl_matrix< double > *A, vnl_matrix< double > *B, vnl_vector< double > *alphar, vnl_vector< double > *alphai, vnl_vector< double > *beta, vnl_matrix< double > *L, vnl_matrix< double > *R)
vnl_matrix & fill(T const &)
Sets all elements of matrix to specified value, and returns "*this".
vnl_vector & fill(T const &v)
Set all values to v.
T const * data_block() const
Access the contiguous block storing the elements in the matrix row-wise. O(1).
unsigned int rows() const
Return the number of rows.
bool set_size(unsigned r, unsigned c)
Resize to r rows by c columns. Old data lost.