rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWEigDecomp< TypeT > Class Template Reference
[Nonsymmetric Eigenvalue Decomposition]

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

#include <rw/lapack/eig.h>

List of all members.

Public Member Functions

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

Detailed Description

template<class TypeT>
class RWEigDecomp< TypeT >

The class RWEigDecomp<T> 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>

Examples

 #include <iostream>
 #include <rw/lapack/eig.h>
 
 int main()
 {
    RWGenMat<double> A;
    std::cin >> A;
    RWEigDecomp<double> eig(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< double > &  A  ) 

Copy and precision conversion constructors. 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>
void 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.

 All Classes Functions Variables Typedefs Enumerations Enumerator Friends

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.