|
NumericAL
A header-only C++20 lexer built on REAL
|
The eigenvalues and eigenvectors of a real symmetric matrix. More...
#include <factorizations.hpp>
Public Member Functions | |
| symmetric_eigen (const matrix< double > &input, eigen_method method=eigen_method::divide_and_conquer) | |
Diagonalises input. | |
| symmetric_eigen (matrix< double > &&input, eigen_method method=eigen_method::divide_and_conquer) | |
Diagonalises input in its own storage, an expiring matrix's elements taken over: its scaled copy is made in place, one matrix less at the peak. | |
| symmetric_eigen (const matrix< double > &a, const matrix< double > &b, eigen_method method=eigen_method::divide_and_conquer) | |
Diagonalises the pencil A − λ B, A x = λ B x, as scipy.linalg.eigh(a, b): B = L Lᴴ and the symmetric L⁻¹ A L⁻ᴴ diagonalised, its eigenvectors y the pencil's L⁻ᴴ y, B-orthonormal (Xᵀ B X = I). Each matrix's lower triangle alone is read. | |
| const vector< double > & | values () const noexcept |
| The eigenvalues, ascending. | |
| const matrix< double > & | vectors () const &noexcept |
| The eigenvectors as columns, ordered to match values. | |
| matrix< double > | vectors () && |
| The eigenvectors, moved out of an expiring decomposition. | |
Private Member Functions | |
| symmetric_eigen (detail::definite_pencil< double > pencil, eigen_method method) | |
| The pencil's eigenpairs: its standard form's, the vectors carried back. | |
| void | extract_sorted (const buffer< double > &diagonal, const buffer< double > &v) |
Sorts the eigenvalues diagonal ascending and reorders v's columns to match. | |
Private Attributes | |
| std::size_t | n_ |
| The matrix order. | |
| vector< double > | values_ |
| Eigenvalues, ascending. | |
| matrix< double > | vectors_ |
| Eigenvectors as columns. | |
The eigenvalues and eigenvectors of a real symmetric matrix.
By default the matrix is reduced to tridiagonal form by Householder reflections and the tridiagonal is diagonalised by divide and conquer (eigen_method::divide_and_conquer), the method of LAPACK's dsyevd, most of its work in matrix products; implicit QL (eigen_method::tridiagonal_ql, dsyev's) and cyclic Jacobi rotations (eigen_method::jacobi) are the alternatives. Whichever, the eigenvalues are real and the eigenvectors orthonormal. The eigenvalues are returned in ascending order, with vectors j-th column the eigenvector of values [j] (A = V Λ Vᵀ). Real symmetric only (the complex Hermitian case is hermitian_eigen). Only the lower triangle is read, as numpy.linalg.eigh reads it by default: the upper one is taken to mirror it.
Definition at line 6674 of file factorizations.hpp.
|
inlineexplicit |
Diagonalises input.
| [in] | input | A real symmetric matrix (its lower triangle is read). |
| [in] | method | The algorithm. |
| dimension_error | If input is not square. |
| convergence_error | If the method did not converge within its bound. |
Definition at line 6685 of file factorizations.hpp.
|
inlineexplicit |
Diagonalises input in its own storage, an expiring matrix's elements taken over: its scaled copy is made in place, one matrix less at the peak.
| [in] | input | A real symmetric matrix (its lower triangle is read). |
| [in] | method | The algorithm. |
| dimension_error | If input is not square. |
| convergence_error | If the method did not converge within its bound. |
Definition at line 6699 of file factorizations.hpp.
|
inline |
Diagonalises the pencil A − λ B, A x = λ B x, as scipy.linalg.eigh(a, b): B = L Lᴴ and the symmetric L⁻¹ A L⁻ᴴ diagonalised, its eigenvectors y the pencil's L⁻ᴴ y, B-orthonormal (Xᵀ B X = I). Each matrix's lower triangle alone is read.
| [in] | a | A real symmetric matrix. |
| [in] | b | A real symmetric positive-definite matrix of its order. |
| [in] | method | The algorithm for the standard form. |
| dimension_error | If a or b is not square, or their orders differ. |
| non_finite_error | If an entry read is infinite or NaN. |
| not_positive_definite_error | If b is not positive definite. |
| convergence_error | If the method did not converge within its bound. |
Definition at line 6775 of file factorizations.hpp.
|
inlineprivate |
The pencil's eigenpairs: its standard form's, the vectors carried back.
Definition at line 6803 of file factorizations.hpp.
|
inlineprivate |
Sorts the eigenvalues diagonal ascending and reorders v's columns to match.
Definition at line 6812 of file factorizations.hpp.
The eigenvalues, ascending.
Definition at line 6783 of file factorizations.hpp.
The eigenvectors, moved out of an expiring decomposition.
Definition at line 6795 of file factorizations.hpp.
The eigenvectors as columns, ordered to match values.
Definition at line 6789 of file factorizations.hpp.
|
private |
The matrix order.
Definition at line 6835 of file factorizations.hpp.
Eigenvalues, ascending.
Definition at line 6836 of file factorizations.hpp.
Eigenvectors as columns.
Definition at line 6837 of file factorizations.hpp.