rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWHermEigDecomp< TypeT > Class Template Reference
[Symmetric Eigenvalue Decomposition]

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

#include <rw/lapack/hermeig.h>

List of all members.

Public Member Functions

 RWHermEigDecomp ()
 RWHermEigDecomp (const RWHermMat< TypeT > &A, bool computeVecs=true)
 RWHermEigDecomp (const RWHermBandMat< TypeT > &A, bool computeVecs=true)
void factor (const RWHermMat< TypeT > &A, bool computeVecs=true)
void factor (const RWHermBandMat< TypeT > &A, bool computeVecs=true)
void operator= (const RWHermEigDecomp< TypeT > &A)
unsigned cols () const
double eigenValue (int i) const
const RWMathVec< double > eigenValues () const
const RWMathVec< TypeT > eigenVector (int i) const
const RWGenMat< TypeT > eigenVectors () const
bool good () const
bool inaccurate () const
bool fail () const
unsigned numEigenValues () const
unsigned numEigenVectors () const
unsigned rows () const

Detailed Description

template<class TypeT>
class RWHermEigDecomp< TypeT >

The class RWHermEigDecomp<T> encapsulates the eigenvalues and eigenvectors of a Hermitian matrix. You can construct an eigenvalue decomposition object in two ways:

Synopsis

 #include <rw/lapack/hermeig.h>    // RWHermEigDecomp<T>
 
 RWHermEigDecomp<DComplex> eig(A); // A is an RWHermMat<DComplex>

Examples

 #include <iostream>
 #include <rw/lapack/hermeig.h>
 
 int main()
 {
     RWHermMat<DComplex> A;
     std::cin >> A;
     RWHermEigDecomp<DComplex> eig(A);
     std::cout << "eigenvalues: " << eig.eigenValues() << std::endl;
     std::cout << "eigenvectors: " << eig.eigenVectors() << std::endl;

     return 0;
 }

Constructor & Destructor Documentation

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

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

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

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

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

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


Member Function Documentation

template<class TypeT>
unsigned RWHermEigDecomp< TypeT >::cols (  )  const [inline]

Returns the number of columns in the decomposed matrix.

template<class TypeT>
double RWHermEigDecomp< TypeT >::eigenValue ( int  i  )  const

Returns the i th eigenvalue.

template<class TypeT>
const RWMathVec<double> RWHermEigDecomp< TypeT >::eigenValues (  )  const [inline]

Returns a vector of all computed eigenvalues.

template<class TypeT>
const RWMathVec<TypeT> RWHermEigDecomp< TypeT >::eigenVector ( int  i  )  const

Returns the i th eigenvector.

template<class TypeT>
const RWGenMat<TypeT> RWHermEigDecomp< TypeT >::eigenVectors (  )  const [inline]

Returns a matrix whose columns are the eigenvectors.

template<class TypeT>
void RWHermEigDecomp< TypeT >::factor ( const RWHermBandMat< TypeT > &  A,
bool  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.

template<class TypeT>
void RWHermEigDecomp< TypeT >::factor ( const RWHermMat< TypeT > &  A,
bool  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.

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

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

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

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

template<class TypeT>
bool RWHermEigDecomp< 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>
unsigned RWHermEigDecomp< TypeT >::numEigenValues (  )  const [inline]

Returns the number of eigenvalues in this object.

template<class TypeT>
unsigned RWHermEigDecomp< TypeT >::numEigenVectors (  )  const [inline]

Returns the number of eigenvectors in this object.

template<class TypeT>
void RWHermEigDecomp< TypeT >::operator= ( const RWHermEigDecomp< TypeT > &  A  ) 

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

template<class TypeT>
unsigned RWHermEigDecomp< 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.