>
>#include <rw/deig.h> // DoubleEigDecomp #include <rw/ceig.h> // DComplexEigDecomp DoubleEigDecomp eig(A); // A is an RWGenMat<double>
The classes {TYPE}EigDecomp encapsulate 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 {TYPE}EigServer in this manual for details.
#include <iostream.h> #include <rw/deig.h> main() { RWGenMat<double> A; cin >> A; DoubleEigDecomp eig(A); cout << "eigenvalues: " << eig.eigenValues() << endl; cout << "left eigenvectors: " << eig.leftEigenVectors()>
<< endl; cout << "right vectors: " << eig.rightEigenVectors() << endl; }
DoubleEigDecomp(); DComplexEigDecomp();
Default constructor. Builds a decomposition of a 0 x 0 matrix.
DoubleEigDecomp(const DoubleEigDecomp& A); DComplexEigDecomp(const DComplexEigDecomp& A); DComplexEigDecomp(const DoubleEigDecomp& A);
Copy and precision conversion constructors. Where possible, data is referenced for efficiency.
DoubleEigDecomp(const RWGenMat<double>& A,
RWBoolean computeVecs=TRUE); DComplexEigDecomp(const RWGenMat<DComplex>& A,
RWBoolean compVecs=TRUE);
Constructs a representation of the eigenvalues and eigenvectors of the matrix A. The boolean parameter controls whether eigenvectors are computed.
unsigned DoubleEigDecomp::cols(); unsigned DComplexEigDecomp::cols();
Returns the number of columns in the decomposed matrix.
DComplex DoubleEigDecomp::eigenValue(int i) const; DComplex DComplexEigDecomp::eigenValue(int i) const;
Returns the ith eigenvalue.
RWMathVec<DComplex> DoubleEigDecomp::eigenValues() const; RWMathVec<DComplex> DComplexEigDecomp::eigenValues() const;
Returns a vector of all computed eigenvalues.
void DoubleEigDecomp::factor(const RWGenMat<double>& A,
RWBoolean computeVecs=TRUE); void DComplexEigDecomp::factor(const RWGenMat<DComplex>& A,
RWBoolean compVecs=TRUE);
Constructs a representation of the eigenvalues and eigenvectors of the matrix A. The boolean parameter controls whether eigenvectors are computed. The current contents of the decomposition are lost.
RWBoolean DoubleEigDecomp::fail() const; RWBoolean DComplexEigDecomp::fail() const;
Returns TRUE if an eigenvalue or eigenvector that is supposed to be computed fails to be computed.
RWBoolean DoubleEigDecomp::good() const; RWBoolean DComplexEigDecomp::good() const;
Returns TRUE if all desired eigenvalues and eigenvectors are successfully computed to full desired accuracy.
RWBoolean DoubleEigDecomp::inaccurate() const; RWBoolean DComplexEigDecomp::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.
RWMathVec<DComplex> DoubleEigDecomp::leftEigenVector(int i) const; RWMathVec<DComplex> DComplexEigDecomp::leftEigenVector(int i) const;
Returns the ith left eigenvector.
RWGenMat<DComplex> DoubleEigDecomp::leftEigenVectors() const; RWGenMat<DComplex> DComplexEigDecomp::leftEigenVectors() const;
Returns a vector of all computed left eigenvectors.
unsigned DoubleEigDecomp::numEigenValues() const; unsigned DoubleEigDecomp::numLeftEigenVectors() const; unsigned DoubleEigDecomp::numRightEigenVectors() const; unsigned DComplexEigDecomp::numEigenValues() const; unsigned DComplexEigDecomp::numLeftEigenVectors() const; unsigned DComplexEigDecomp::numRightEigenVectors() const;
Returns the number of eigenvalues or eigenvectors represented in this object.
RWMathVec<DComplex> DoubleEigDecomp::rightEigenVector(int i) const; RWMathVec<DComplex> DComplexEigDecomp::rightEigenVector(int i) const;
Returns the ith right eigenvector.
RWGenMat<DComplex> DoubleEigDecomp::rightEigenVectors() const; RWGenMat<DComplex> DComplexEigDecomp::rightEigenVectors() const;
Returns a matrix of all computed right eigenvectors.
unsigned DoubleEigDecomp::rows(); unsigned DComplexEigDecomp::rows();
Returns the number of rows in the decomposed matrix.
void DoubleEigDecomp::operator=(const DoubleEigDecomp&); void DComplexEigDecomp::operator=(const DComplexEigDecomp&);
Assigns the passed value to this decomposition. The current contents of the decomposition are lost.
©Copyright 1999, Rogue Wave Software, Inc.
Send mail to report errors or comment on the documentation.