SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWSchurDecomp< TypeT > Class Template Reference

Encapsulates a Schur decomposition as well as an optional balance transformation. More...

#include <rw/lapack/schur.h>

Public Member Functions

 RWSchurDecomp ()
 
 RWSchurDecomp (const RWBalanceDecomp< TypeT > &)
 
 RWSchurDecomp (const RWGenMat< TypeT > &A, bool permute=true, bool scale=true)
 
 RWSchurDecomp (const RWHessenbergDecomp< TypeT > &)
 
RWGenMat< TypeT > B () const
 
RWGenMat< TypeT > BInvTX (const RWGenMat< TypeT > &X) const
 
RWMathVec< TypeT > BInvTx (const RWMathVec< TypeT > &x) const
 
RWGenMat< TypeT > BX (const RWGenMat< TypeT > &X) const
 
RWMathVec< TypeT > Bx (const RWMathVec< TypeT > &x) const
 
unsigned cols () const
 
DComplex eigenvalue (int) const
 
RWMathVec< DComplexeigenvalues () const
 
void factor (const RWBalanceDecomp< TypeT > &)
 
void factor (const RWGenMat< TypeT > &A, bool permute=true, bool scale=true)
 
void factor (const RWHessenbergDecomp< TypeT > &)
 
bool good () const
 
int move (int i, int j)
 
bool moveToFront (const RWMathVec< int > &)
 
unsigned rows () const
 
RWGenMat< TypeT > T () const
 
RWGenMat< TypeT > Z () const
 
RWGenMat< TypeT > ZTX (const RWGenMat< TypeT > &X) const
 
RWMathVec< TypeT > ZTx (const RWMathVec< TypeT > &x) const
 
RWGenMat< TypeT > ZX (const RWGenMat< TypeT > &X) const
 
RWMathVec< TypeT > Zx (const RWMathVec< TypeT > &x) const
 

Detailed Description

template<class TypeT>
class RWSchurDecomp< TypeT >

A Schur decomposition uses orthogonal transformations to reduce a matrix A to a matrix T that is upper quasitriangular. For a complex matrix, T is actually triangular. For a real matrix, T is triangular, except the diagonal can contain 2 x 2 blocks, allowing nonzero entries on the subdiagonal. The columns of the orthogonal transformation matrix, Z, are called Schur vectors.

The class RWSchurDecomp encapsulates a Schur decomposition as well as an optional balance transformation. The decomposition of a matrix A is:

\[ A = BZTZ'B^{-1} \]

where Z is orthogonal, T is quasi-upper triangular, and B is a balance transformation (see RWBalanceTransform ). The Schur decomposition yields eigenvalues immediately. Since the eigenvalues of A and T are the same, and since T is quasi-upper triangular, the eigenvalues are simply either the diagonal elements of T, or the complex conjugate pair corresponding to the eigenvalues of a 2 x 2 block on the diagonal. The invariant subspace corresponding to the first k eigenvalues of A is spanned by the first k Schur vectors; since the matrix of Schur vectors, Z, is orthogonal, this basis is orthonormal. Often, the Schur vectors are preferable to the eigenvectors themselves because of this orthogonality.

Synopsis
#include <rw/lapack/schur.h>
RWSchurDecomp<double> schur(A); // A is an RWGenMat<double>
Encapsulates a Schur decomposition as well as an optional balance transformation.
Definition schur.h:87
Example
#include <rw/lapack/hess.h>
#include <iostream>
int main() {
std::cin >> A;
RWSchurDecomp<double> schur(A, false, false); //false for
// no balancing
std::cout << "Input matrix: " << A << std::endl;
std::cout << "eigenvalues: " << schur.eigenvalues() << std::endl;
std::cout << "Schur vectors: " << schur.Z() << std::endl;
return 0;
}
A templatized general matrix class.
Definition genmat.h:741

Constructor & Destructor Documentation

◆ RWSchurDecomp() [1/4]

template<class TypeT >
RWSchurDecomp< TypeT >::RWSchurDecomp ( )

Default constructor. Builds a decomposition of size 0 x 0.

◆ RWSchurDecomp() [2/4]

template<class TypeT >
RWSchurDecomp< TypeT >::RWSchurDecomp ( const RWGenMat< TypeT > & A,
bool permute = true,
bool scale = true )

Constructs the Schur decomposition of the matrix A. The boolean parameters determine whether or not the permutation or scaling parts of the balance transformation are applied prior to forming the Schur decomposition.

◆ RWSchurDecomp() [3/4]

template<class TypeT >
RWSchurDecomp< TypeT >::RWSchurDecomp ( const RWBalanceDecomp< TypeT > & )

Builds a Schur decomposition of the matrix represented by the balance decomposition.

◆ RWSchurDecomp() [4/4]

template<class TypeT >
RWSchurDecomp< TypeT >::RWSchurDecomp ( const RWHessenbergDecomp< TypeT > & )

Builds a Schur decomposition of the matrix represented by the Hessenberg decomposition.

Member Function Documentation

◆ B()

template<class TypeT >
RWGenMat< TypeT > RWSchurDecomp< TypeT >::B ( ) const

Computes an explicit representation of the balance transformation.

◆ BInvTX()

template<class TypeT >
RWGenMat< TypeT > RWSchurDecomp< TypeT >::BInvTX ( const RWGenMat< TypeT > & X) const

Computes the inner product of the balance transformation B, or its (conjugate) transpose inverse, and the matrix X.

◆ BInvTx()

template<class TypeT >
RWMathVec< TypeT > RWSchurDecomp< TypeT >::BInvTx ( const RWMathVec< TypeT > & x) const

Computes the inner product of the balance transformation B, or its (conjugate) transpose inverse, and the vector x.

◆ BX()

template<class TypeT >
RWGenMat< TypeT > RWSchurDecomp< TypeT >::BX ( const RWGenMat< TypeT > & X) const

Computes the inner product of the balance transformation B, or its (conjugate) transpose inverse, and the matrix X.

◆ Bx()

template<class TypeT >
RWMathVec< TypeT > RWSchurDecomp< TypeT >::Bx ( const RWMathVec< TypeT > & x) const

Computes the inner product of the balance transformation B, or its (conjugate) transpose inverse, and the vector x.

◆ cols()

template<class TypeT >
unsigned RWSchurDecomp< TypeT >::cols ( ) const
inline

Returns the number of columns in the matrix that the decomposition represents.

◆ eigenvalue()

template<class TypeT >
DComplex RWSchurDecomp< TypeT >::eigenvalue ( int ) const

Returns the i th eigenvalue.

◆ eigenvalues()

template<class TypeT >
RWMathVec< DComplex > RWSchurDecomp< TypeT >::eigenvalues ( ) const
inline

Returns a vector of all computed eigenvalues.

◆ factor() [1/3]

template<class TypeT >
void RWSchurDecomp< TypeT >::factor ( const RWBalanceDecomp< TypeT > & )

Replaces the current decomposition with the Schur decomposition of the matrix represented by the balance decomposition.

◆ factor() [2/3]

template<class TypeT >
void RWSchurDecomp< TypeT >::factor ( const RWGenMat< TypeT > & A,
bool permute = true,
bool scale = true )

Replaces the current decomposition with the Schur decomposition of the matrix A. The boolean parameters determine whether or not the permutation or scaling parts of the balance transformation are applied prior to forming the Schur decomposition.

◆ factor() [3/3]

template<class TypeT >
void RWSchurDecomp< TypeT >::factor ( const RWHessenbergDecomp< TypeT > & )

Replaces the current decomposition with the Schur decomposition of the matrix represented by the Hessenberg decomposition.

◆ good()

template<class TypeT >
bool RWSchurDecomp< TypeT >::good ( ) const

Returns true if the decomposition was successfully computed, false if not.

◆ move()

template<class TypeT >
int RWSchurDecomp< TypeT >::move ( int i,
int j )

Reorders the decomposition so that the i theigenvalue is moved to the j th position. In the real case, if i corresponds to a 2 x 2 block (a complex eigenvalue), the entire block is moved. The function returns where the eigenvalue was actually moved to; this may differ from j for two reasons: it may have been impossible to move the eigenvalue to position j due to the presence of 2 x 2 blocks, or the matrix may be extremely ill-conditioned.

◆ moveToFront()

template<class TypeT >
bool RWSchurDecomp< TypeT >::moveToFront ( const RWMathVec< int > & )

Reorders the decomposition so that the eigenvalues whose indices are passed in the vector are moved to the front. In the real case, if an index corresponds to a 2 x 2 block (a complex eigenvalue), the entire block is moved. The function returns true if the reordering is successful.

◆ rows()

template<class TypeT >
unsigned RWSchurDecomp< TypeT >::rows ( ) const
inline

Returns the number of rows in the matrix that the decomposition represents.

◆ T()

template<class TypeT >
RWGenMat< TypeT > RWSchurDecomp< TypeT >::T ( ) const

Computes an explicit representation of the quasi-upper triangular matrix T.

◆ Z()

template<class TypeT >
RWGenMat< TypeT > RWSchurDecomp< TypeT >::Z ( ) const

Computes an explicit representation of the orthogonal matrix Z.

◆ ZTX()

template<class TypeT >
RWGenMat< TypeT > RWSchurDecomp< TypeT >::ZTX ( const RWGenMat< TypeT > & X) const

Computes the inner product of the orthogonal matrix Z, or its (conjugate) transpose, and the matrix X.

◆ ZTx()

template<class TypeT >
RWMathVec< TypeT > RWSchurDecomp< TypeT >::ZTx ( const RWMathVec< TypeT > & x) const

Computes the inner product of the orthogonal matrix Z, or its (conjugate) transpose, and the vector x.

◆ ZX()

template<class TypeT >
RWGenMat< TypeT > RWSchurDecomp< TypeT >::ZX ( const RWGenMat< TypeT > & X) const

Computes the inner product of the orthogonal matrix Z, or its (conjugate) transpose, and the matrix X.

◆ Zx()

template<class TypeT >
RWMathVec< TypeT > RWSchurDecomp< TypeT >::Zx ( const RWMathVec< TypeT > & x) const

Computes the inner product of the orthogonal matrix Z, or its (conjugate) transpose, and the vector x.

Copyright © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.