|
NumericAL
A header-only C++20 lexer built on REAL
|
The generalized real Schur decomposition of a real pencil A − λ B, A = Q S Zᵀ and B = Q T Zᵀ, as scipy.linalg.qz(a, b) (LAPACK's dgges): Q and Z orthogonal, T upper triangular with a non-negative diagonal, S quasi-triangular, a 2 × 2 diagonal block for each conjugate pair of eigenvalues, T diagonal and positive there; the eigenvalues (αr + i αi) / β (β = 0 an infinite one).
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, α = αr + i αi. | |
Public Member Functions | |
| real_generalized_schur (const matrix< double > &a, const matrix< double > &b) | |
Decomposes the pencil of a and b. | |
| real_generalized_schur (const matrix< double > &a, const matrix< double > &b, std::size_t steps) | |
Decomposes the pencil within steps QZ iterations (dhgeqz's bound 30 n by default). | |
| matrix< double > | s () const |
S, quasi-triangular. | |
| matrix< double > | t () const |
T, upper triangular, its diagonal non-negative. | |
| matrix< double > | q () const |
Q, orthogonal: A = Q S Zᵀ. | |
| matrix< double > | z () const |
Z, orthogonal. | |
| const std::vector< detail::real_pencil_value > & | values () const noexcept |
The eigenvalues as (αr, αi, β), in the diagonal's order. | |
| 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 dtgsen (by dtgexc's exchanges of blocks), a conjugate pair moved together where either of its two is chosen; Q and Z turning with them, the eigenvalues recomputed as dtgsen gives them. | |
| 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< detail::real_pencil_value > | unscaled (std::vector< detail::real_pencil_value > raw) const |
The eigenvalues of the scaled form raw taken back, as dgges takes them: α by A's factor, β by B's; a conjugate pair whose α or β would leave the range first rescaled as a whole (its ratio kept) to the size of its block's entries. A pair of αr = 0 takes the second test (dgges divides by it). | |
Private Attributes | |
| detail::real_qz_form | form_ |
| S, T, Q and Z, of the scaled pencil. | |
| std::vector< detail::real_pencil_value > | values_ |
| The eigenvalues. | |
| double | a_back_ {1.0} |
| The factor taking S back to A's scale. | |
| double | b_back_ {1.0} |
| T's. | |
The generalized real Schur decomposition of a real pencil A − λ B, A = Q S Zᵀ and B = Q T Zᵀ, as scipy.linalg.qz(a, b) (LAPACK's dgges): Q and Z orthogonal, T upper triangular with a non-negative diagonal, S quasi-triangular, a 2 × 2 diagonal block for each conjugate pair of eigenvalues, T diagonal and positive there; the eigenvalues (αr + i αi) / β (β = 0 an infinite one).
Definition at line 2426 of file generalized.hpp.
| using numerical::real_generalized_schur::selection = std::function<bool (const std::complex<double>&, const std::complex<double>&)> |
The selection scipy.linalg.ordqz takes: true for (α, β) to lead, α = αr + i αi.
Definition at line 2494 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 2436 of file generalized.hpp.
|
inline |
Decomposes the pencil within steps QZ iterations (dhgeqz's bound 30 n by default).
Definition at line 2444 of file generalized.hpp.
Q, orthogonal: A = Q S Zᵀ.
Definition at line 2476 of file generalized.hpp.
Moves the eigenvalues whose entries of chosen are set to the leading diagonal places, in their order, as LAPACK's dtgsen (by dtgexc's exchanges of blocks), a conjugate pair moved together where either of its two is chosen; Q and Z turning with them, the eigenvalues recomputed as dtgsen gives them.
| dimension_error | If chosen does not hold one entry per eigenvalue. |
| convergence_error | If an exchange is refused (dtgex2's tests: two eigenvalues too close to separate); the decomposition is then unchanged. |
Definition at line 2505 of file generalized.hpp.
S, quasi-triangular.
Definition at line 2464 of file generalized.hpp.
The eigenvalues select holds moved first (reorder), as scipy.linalg.ordqz(…, sort=…) sorts them.
Definition at line 2528 of file generalized.hpp.
T, upper triangular, its diagonal non-negative.
Definition at line 2470 of file generalized.hpp.
|
inlineprivate |
The eigenvalues of the scaled form raw taken back, as dgges takes them: α by A's factor, β by B's; a conjugate pair whose α or β would leave the range first rescaled as a whole (its ratio kept) to the size of its block's entries. A pair of αr = 0 takes the second test (dgges divides by it).
Definition at line 2544 of file generalized.hpp.
|
inlinenoexcept |
The eigenvalues as (αr, αi, β), in the diagonal's order.
Definition at line 2488 of file generalized.hpp.
Z, orthogonal.
Definition at line 2482 of file generalized.hpp.
|
private |
The factor taking S back to A's scale.
Definition at line 2582 of file generalized.hpp.
|
private |
T's.
Definition at line 2583 of file generalized.hpp.
|
private |
S, T, Q and Z, of the scaled pencil.
Definition at line 2580 of file generalized.hpp.
|
private |
The eigenvalues.
Definition at line 2581 of file generalized.hpp.