>
>#include <rw/fseig.h> // FloatSymEigDecomp #include <rw/dseig.h> // DoubleSymEigDecomp #include <rw/cseig.h> // DComplexHermEigDecomp DoubleSymEigDecomp eig(A); // A is an RWGenMat<double>
The classes {TYPE}SymEigDecomp encapsulate the eigenvalues and eigenvectors of a symmetric matrix, a Hermitian in the complex case. 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}SymEigServer in this manual for details.
#include <iostream.h> #include <rw/deig.h> main() { DoubleSymMat A; cin >> A; DoubleSymEigDecomp eig(A); cout << "eigenvalues: " << eig.eigenValues() << endl; cout << "eigenvectors: " << eig.eigenVectors() << endl; }>
FloatSymEigDecomp(); DoubleSymEigDecomp(); DComplexHermEigDecomp();
Default constructor. Builds a decomposition of a 0 x 0 matrix.
FloatSymEigDecomp(const FloatSymEigDecomp& A); DoubleSymEigDecomp(const DoubleSymEigDecomp& A); DComplexHermEigDecomp(const DComplexHermEigDecomp& A); DComplexHermEigDecomp(const DoubleSymEigDecomp& A);
Copy and precision conversion constructors. Where possible, data is referenced for efficiency.
FloatSymEigDecomp(const FloatSymMat& A, RWBoolean computeVecs=TRUE); DoubleSymEigDecomp(const DoubleSymMat& A, RWBoolean computeVecs=TRUE); DComplexHermEigDecomp(const DComplexHermMat& A, RWBoolean computeVecs=TRUE); FloatSymEigDecomp(const FloatSymBandMat& A,
RWBoolean cv=TRUE); DoubleSymEigDecomp(const DoubleSymBandMat& A, RWBoolean computeVecs =TRUE); DComplexHermEigDecomp(const DComplexHermBandMat& A, RWBoolean =TRUE);
Constructs a representation of the eigenvalues and eigenvectors of the matrix A. The boolean parameter controls whether eigenvectors are computed.
unsigned FloatSymEigDecomp::cols(); unsigned DoubleSymEigDecomp::cols(); unsigned DComplexHermEigDecomp::cols();
Returns the number of columns in the decomposed matrix.
float FloatSymEigDecomp::eigenValue(int i) const; double DoubleSymEigDecomp::eigenValue(int i) const; double DComplexHermEigDecomp::eigenValue(int i) const;
Returns the ith eigenvalue.
RWMathVec<float> FloatSymEigDecomp::eigenValues() const; RWMathVec<double> DoubleSymEigDecomp::eigenValues() const; RWMathVec<double> DComplexHermEigDecomp::eigenValues() const;
Returns a vector of all computed eigenvalues.
RWMathVec<float> FloatSymEigDecomp::eigenVector(int i) const; RWMathVec<double> DoubleSymEigDecomp::eigenVector(int i) const; RWMathVec<DComplex> DComplexHermEigDecomp::eigenVector(int i) const;
Returns the ith eigenvector.
RWGenMat<float> FloatSymEigDecomp::eigenVectors() const; RWGenMat<double> DoubleSymEigDecomp::eigenVectors() const; RWGenMat<DComplex> DComplexHermEigDecomp::eigenVectors() const;
Returns a matrix whose columns are the eigenvectors.
void FloatSymEigDecomp::factor(const FloatSymMat& A,
RWBoolean computeVecs=TRUE); void DoubleSymEigDecomp::factor(const DoubleSymMat& A,
RWBoolean computeVecs=TRUE); void DComplexHermEigDecomp::factor(const DComplexHermMat& A,
RWBoolean computeVecs =TRUE); void FloatSymEigDecomp::factor(const FloatSymBandMat& A,
RWBoolean computeVecs=TRUE); void DoubleSymEigDecomp::factor(const DoubleSymBandMat& A,
RWBoolean computeVecs=TRUE); void DComplexHermEigDecomp::factor(DComplexHermBandMat& A,
RWBoolean computeVecs=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 FloatSymEigDecomp::fail() const; RWBoolean DoubleSymEigDecomp::fail() const; RWBoolean DComplexHermEigDecomp::fail() const;
Returns TRUE if an eigenvalue or eigenvector that is supposed to be computed fails to be computed.
RWBoolean FloatSymEigDecomp::good() const; RWBoolean DoubleSymEigDecomp::good() const; RWBoolean DComplexHermEigDecomp::good() const;
Returns TRUE if all desired eigenvalues and eigenvectors are successfully computed to full desired accuracy.
RWBoolean FloatSymEigDecomp::inaccurate() const; RWBoolean DoubleSymEigDecomp::inaccurate() const; RWBoolean DComplexHermEigDecomp::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.
unsigned FloatSymEigDecomp::numEigenValues() const; unsigned DoubleSymEigDecomp::numEigenValues() const; unsigned DComplexHermEigDecomp::numEigenValues() const;
Returns the number of eigenvalues in this object.
unsigned FloatSymEigDecomp::numEigenVectors() const; unsigned DoubleSymEigDecomp::numEigenVectors() const; unsigned DComplexHermEigDecomp::numEigenVectors() const;
Returns the number of eigenvectors in this object.
unsigned FloatSymEigDecomp::rows(); unsigned DoubleSymEigDecomp::rows(); unsigned DComplexHermEigDecomp::rows();
Returns the number of rows in the decomposed matrix.
void FloatSymEigDecomp::operator=
(const FloatSymEigDecomp&); void DoubleSymEigDecomp::operator=
(const DoubleSymEigDecomp&); void DComplexHermEigDecomp::operator=
(const DComplexHermEigDecomp&);
Assigns this decomposition the passed value. The current contents of the decomposition are lost.
©Copyright 1999, Rogue Wave Software, Inc.
Send mail to report errors or comment on the documentation.