|
NumericAL
A header-only C++20 lexer built on REAL
|
The generalized Schur decomposition of a complex pencil A − λ B, A = Q S Zᴴ and B = Q T Zᴴ, as scipy.linalg.qz(a, b, output="complex") (LAPACK's zgges): Q and Z unitary, S and T upper triangular, T's diagonal real and non-negative; the generalized eigenvalues α_k / β_k on the diagonals (β_k = 0 an infinite one). Reordered as scipy.linalg.ordqz by sort or reorder. Each operand is first brought into the range [√safmin / ε, ε / √safmin] of its largest magnitude where it lies outside, as zgges scales it, and the form and the eigenvalues taken back.
More...
#include <generalized.hpp>
Public Types | |
| using | selection = std::function< bool(const std::complex< double > &, const std::complex< double > &)> |
The selection scipy.linalg.ordqz takes: true for (α, β) to lead. | |
Public Member Functions | |
| generalized_schur (const matrix< std::complex< double > > &a, const matrix< std::complex< double > > &b) | |
Decomposes the pencil of a and b. | |
| generalized_schur (const matrix< std::complex< double > > &a, const matrix< std::complex< double > > &b, std::size_t steps) | |
Decomposes the pencil within steps QZ iterations (zhgeqz's bound 30 n by default). | |
| matrix< std::complex< double > > | s () const |
S, upper triangular. | |
| matrix< std::complex< double > > | t () const |
T, upper triangular, its diagonal real and non-negative. | |
| matrix< std::complex< double > > | q () const |
Q, unitary: A = Q S Zᴴ. | |
| matrix< std::complex< double > > | z () const |
Z, unitary. | |
| const std::vector< std::pair< std::complex< double >, std::complex< double > > > & | values () const noexcept |
The eigenvalues as (α, β), in the diagonals' order: α = S(k, k), β = T(k, k). | |
| std::size_t | reorder (const std::vector< bool > &chosen) |
Moves the eigenvalues whose entries of chosen are set to the leading diagonal places, in their order, as LAPACK's ztgsen (by ztgexc's exchanges), Q and Z turning with them, T's diagonal made real and non-negative again. | |
| std::size_t | sort (const selection &select) |
The eigenvalues select holds moved first (reorder), as scipy.linalg.ordqz(…, sort=…) sorts them. | |
Private Member Functions | |
| std::vector< std::pair< std::complex< double >, std::complex< double > > > | unscaled (std::vector< std::pair< std::complex< double >, std::complex< double > > > raw) const |
The eigenvalues of the scaled form raw taken back: α by A's factor, β by B's. | |
Private Attributes | |
| detail::qz_form | form_ |
| S, T, Q and Z, of the scaled pencil. | |
| std::vector< std::pair< std::complex< double >, std::complex< double > > > | values_ |
| The eigenvalues as (α, β). | |
| double | a_back_ {1.0} |
| The factor taking S back to A's scale. | |
| double | b_back_ {1.0} |
| T's. | |
The generalized Schur decomposition of a complex pencil A − λ B, A = Q S Zᴴ and B = Q T Zᴴ, as scipy.linalg.qz(a, b, output="complex") (LAPACK's zgges): Q and Z unitary, S and T upper triangular, T's diagonal real and non-negative; the generalized eigenvalues α_k / β_k on the diagonals (β_k = 0 an infinite one). Reordered as scipy.linalg.ordqz by sort or reorder. Each operand is first brought into the range [√safmin / ε, ε / √safmin] of its largest magnitude where it lies outside, as zgges scales it, and the form and the eigenvalues taken back.
Definition at line 2174 of file generalized.hpp.
| using numerical::generalized_schur::selection = std::function<bool (const std::complex<double>&, const std::complex<double>&)> |
The selection scipy.linalg.ordqz takes: true for (α, β) to lead.
Definition at line 2179 of file generalized.hpp.
|
inline |
Decomposes the pencil of a and b.
| dimension_error | If a or b is not square or their orders differ. |
| non_finite_error | If an entry is infinite or NaN. |
| convergence_error | If the QZ iterations did not converge. |
Definition at line 2187 of file generalized.hpp.
|
inline |
Decomposes the pencil within steps QZ iterations (zhgeqz's bound 30 n by default).
Definition at line 2195 of file generalized.hpp.
Q, unitary: A = Q S Zᴴ.
Definition at line 2227 of file generalized.hpp.
Moves the eigenvalues whose entries of chosen are set to the leading diagonal places, in their order, as LAPACK's ztgsen (by ztgexc's exchanges), Q and Z turning with them, T's diagonal made real and non-negative again.
| dimension_error | If chosen does not hold one entry per eigenvalue. |
| convergence_error | If an exchange is refused (ztgex2's tests: two eigenvalues too close to separate); the decomposition is then unchanged. |
Definition at line 2252 of file generalized.hpp.
S, upper triangular.
Definition at line 2215 of file generalized.hpp.
The eigenvalues select holds moved first (reorder), as scipy.linalg.ordqz(…, sort=…) sorts them.
Definition at line 2282 of file generalized.hpp.
T, upper triangular, its diagonal real and non-negative.
Definition at line 2221 of file generalized.hpp.
|
inlineprivate |
The eigenvalues of the scaled form raw taken back: α by A's factor, β by B's.
Definition at line 2294 of file generalized.hpp.
|
inlinenoexcept |
The eigenvalues as (α, β), in the diagonals' order: α = S(k, k), β = T(k, k).
Definition at line 2239 of file generalized.hpp.
Z, unitary.
Definition at line 2233 of file generalized.hpp.
|
private |
The factor taking S back to A's scale.
Definition at line 2306 of file generalized.hpp.
|
private |
T's.
Definition at line 2307 of file generalized.hpp.
|
private |
S, T, Q and Z, of the scaled pencil.
Definition at line 2304 of file generalized.hpp.
|
private |
The eigenvalues as (α, β).
Definition at line 2305 of file generalized.hpp.