Class SymmetricSchurDecomposition
The eigenvalues and eigenvectors of a real symmetric matrix, by the symmetric threshold Jacobi algorithm.
public sealed class SymmetricSchurDecomposition
- Inheritance
-
SymmetricSchurDecomposition
- Inherited Members
Remarks
Given a real symmetric matrix S, the Schur decomposition finds the eigenvalues and eigenvectors of S. If D is the diagonal matrix formed by the eigenvalues and U the unitarian matrix of the eigenvectors, S = U·D·Uᵀ. For details on the different Jacobi transformations see "Matrix computation", second edition, by Golub and Van Loan, The Johns Hopkins University Press.
The decomposition is computed in the constructor; Eigenvalues() and Eigenvectors() return copies. The eigenvalues are sorted in decreasing order, each eigenvector with its first component non-negative. A NaN eigenvalue, or a NaN in two equal eigenvalues' eigenvectors where their comparison reads it, is refused: QuantLib sorts the pairs with a comparison that NaN leaves undefined (a divergence).
Constructors
SymmetricSchurDecomposition(Matrix)
Initializes a new instance of the SymmetricSchurDecomposition class.
public SymmetricSchurDecomposition(Matrix s)
Parameters
sMatrixThe matrix, symmetric.
Exceptions
- ArgumentException
sis empty or not square.- NanoQLException
The algorithm doesn't converge in 100 iterations, or the sort would read a NaN (a divergence).
Methods
Eigenvalues()
The eigenvalues, in decreasing order.
public Vector Eigenvalues()
Returns
- Vector
A new vector.
Eigenvectors()
The eigenvectors, one per column in the eigenvalues' order, each with its first component non-negative.
public Matrix Eigenvectors()
Returns
- Matrix
A new matrix.