SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
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
 

Friends

template<class T1 >
class RWEigServer
 

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:

  • Use the decomposition class constructor. This has the advantage of simplicity, but allows only limited control over the computation. Your only choice is whether or not to compute eigenvectors.
  • Use an eigenvalue server object. This gives you more precise control over the computation. See RWEigServer in this manual for details.
Synopsis
#include <rw/lapack/eig.h>
// A is an RWGenMat<double>
Encapsulates the eigenvalues and eigenvectors of a nonsymmetric matrix.
Definition eig.h:69
Example
#include <rw/lapack/eig.h>
#include <iostream>
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;
}
A templatized general matrix class.
Definition genmat.h:741

Constructor & Destructor Documentation

◆ RWEigDecomp() [1/4]

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

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

◆ RWEigDecomp() [2/4]

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

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

◆ RWEigDecomp() [3/4]

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.

◆ RWEigDecomp() [4/4]

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

◆ cols()

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

Returns the number of columns in the decomposed matrix.

◆ eigenValue()

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

Returns the ith eigenvalue.

◆ eigenValues()

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

Returns a vector of all computed eigenvalues.

◆ factor()

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.

◆ fail()

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.

◆ good()

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

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

◆ inaccurate()

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.

◆ leftEigenVector()

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

Returns the ith left eigenvector.

◆ leftEigenVectors()

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

Returns a vector of all computed left eigenvectors.

◆ numEigenValues()

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

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

◆ numLeftEigenVectors()

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

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

◆ numRightEigenVectors()

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

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

◆ operator=()

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.

◆ rightEigenVector()

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

Returns the ith right eigenvector.

◆ rightEigenVectors()

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

Returns a matrix of all computed right eigenvectors.

◆ rows()

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

Returns the number of rows in the decomposed matrix.

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