SourcePro® API Reference Guide

Product Documentation:
   SourcePro
Documentation Home
List of all members | Public Member Functions
RWEigDecomp< TypeT > Class Template Reference

Encapsulates the eigenvalues and eigenvectors of a nonsymmetric matrix. More...

#include <rw/lapack/eig.h>

Public Member Functions

 RWEigDecomp ()
 
 RWEigDecomp (const RWEigDecomp &)
 
template<class TypeU >
 RWEigDecomp (const RWEigDecomp< typename RWTEnableIf< RWTIsSame< TypeU, double >::value, double >::type > &A)
 
 RWEigDecomp (const RWGenMat< TypeT > &A, bool computeVecs=true)
 
unsigned cols () const
 
DComplex eigenValue (int i) const
 
const RWMathVec< DComplexeigenValues () const
 
void factor (const RWGenMat< TypeT > &A, bool computeVecs=true)
 
bool fail () const
 
bool good () const
 
bool inaccurate () const
 
const RWMathVec< DComplexleftEigenVector (int i) const
 
const RWGenMat< DComplexleftEigenVectors () const
 
unsigned numEigenValues () const
 
unsigned numLeftEigenVectors () const
 
unsigned numRightEigenVectors () const
 
RWEigDecomp< TypeT > & operator= (const RWEigDecomp< TypeT > &)
 
const RWMathVec< DComplexrightEigenVector (int i) const
 
const RWGenMat< DComplexrightEigenVectors () const
 
unsigned rows () const
 

Detailed Description

template<class TypeT>
class RWEigDecomp< TypeT >

The class RWEigDecomp encapsulates the eigenvalues and eigenvectors of a nonsymmetric matrix. You can construct an eigenvalue decomposition object in two ways:

Synopsis
#include <rw/lapack/eig.h>
RWEigDecomp<double> eig(A); // A is an
// RWGenMat<double>
Example
#include <iostream>
#include <rw/lapack/eig.h>
int main()
{
std::cin >> A;
std::cout << "eigenvalues: " << eig.eigenValues() <<
std::endl;
std::cout << "left eigenvectors: " << eig.leftEigenVectors()
<< std::endl;
std::cout << "right vectors: " << eig.rightEigenVectors() << endl;
return 0;
}

Constructor & Destructor Documentation

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

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

template<class TypeT>
RWEigDecomp< TypeT >::RWEigDecomp ( const RWEigDecomp< TypeT > &  )

Copy constructor. Where possible, data is referenced for efficiency.

template<class TypeT>
template<class TypeU >
RWEigDecomp< TypeT >::RWEigDecomp ( const RWEigDecomp< typename RWTEnableIf< RWTIsSame< TypeU, double >::value, double >::type > &  A)

precision conversion constructor. Where possible, data is referenced for efficiency.

template<class TypeT>
RWEigDecomp< TypeT >::RWEigDecomp ( const RWGenMat< TypeT > &  A,
bool  computeVecs = true 
)

Constructs a representation of the eigenvalues and eigenvectors of the matrix A. The boolean parameter computeVecs controls whether eigenvectors are computed.

Member Function Documentation

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

Returns the number of columns in the decomposed matrix.

template<class TypeT>
DComplex RWEigDecomp< TypeT >::eigenValue ( int  i) const

Returns the ith eigenvalue.

template<class TypeT>
const RWMathVec<DComplex> RWEigDecomp< TypeT >::eigenValues ( ) const
inline

Returns a vector of all computed eigenvalues.

template<class TypeT>
void RWEigDecomp< TypeT >::factor ( const RWGenMat< TypeT > &  A,
bool  computeVecs = true 
)

Constructs a representation of the eigenvalues and eigenvectors of the matrix A. The boolean parameter computeVecs controls whether eigenvectors are computed. The current contents of the decomposition are lost.

template<class TypeT>
bool RWEigDecomp< TypeT >::fail ( ) const

Returns true if an eigenvalue or eigenvector that is supposed to be computed fails to be computed.

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

Returns true if all desired eigenvalues and eigenvectors are successfully computed to full desired accuracy.

template<class TypeT>
bool RWEigDecomp< TypeT >::inaccurate ( ) const

Returns true if either an eigenvalue or eigenvector that is supposed to be computed fails to be computed, or some of the computed quantities are not computed to full desired accuracy.

template<class TypeT>
const RWMathVec<DComplex> RWEigDecomp< TypeT >::leftEigenVector ( int  i) const

Returns the ith left eigenvector.

template<class TypeT>
const RWGenMat<DComplex> RWEigDecomp< TypeT >::leftEigenVectors ( ) const

Returns a vector of all computed left eigenvectors.

template<class TypeT>
unsigned RWEigDecomp< TypeT >::numEigenValues ( ) const
inline

Returns the number of eigenvalues or eigenvectors represented in this object.

template<class TypeT>
unsigned RWEigDecomp< TypeT >::numLeftEigenVectors ( ) const
inline

Returns the number of eigenvalues or eigenvectors represented in this object.

template<class TypeT>
unsigned RWEigDecomp< TypeT >::numRightEigenVectors ( ) const
inline

Returns the number of eigenvalues or eigenvectors represented in this object.

template<class TypeT>
RWEigDecomp<TypeT>& RWEigDecomp< TypeT >::operator= ( const RWEigDecomp< TypeT > &  )

Assigns the passed value to this decomposition. The current contents of the decomposition are lost.

template<class TypeT>
const RWMathVec<DComplex> RWEigDecomp< TypeT >::rightEigenVector ( int  i) const

Returns the ith right eigenvector.

template<class TypeT>
const RWGenMat<DComplex> RWEigDecomp< TypeT >::rightEigenVectors ( ) const

Returns a matrix of all computed right eigenvectors.

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

Returns the number of rows in the decomposed matrix.

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