SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWHermEigDecomp< TypeT > Class Template Reference

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

#include <rw/lapack/hermeig.h>

Public Member Functions

 RWHermEigDecomp ()
 
 RWHermEigDecomp (const RWHermBandMat< TypeT > &A, bool computeVecs=true)
 
 RWHermEigDecomp (const RWHermEigDecomp< TypeT > &A)
 
 RWHermEigDecomp (const RWHermMat< TypeT > &A, bool computeVecs=true)
 
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
 
void factor (const RWHermBandMat< TypeT > &A, bool computeVecs=true)
 
void factor (const RWHermMat< TypeT > &A, bool computeVecs=true)
 
bool fail () const
 
bool good () const
 
bool inaccurate () const
 
unsigned numEigenValues () const
 
unsigned numEigenVectors () const
 
RWHermEigDecomp< TypeT > & operator= (const RWHermEigDecomp< TypeT > &A)
 
unsigned rows () const
 

Friends

class RWHermEigServer< TypeT >
 

Detailed Description

template<class TypeT>
class RWHermEigDecomp< TypeT >

The class RWHermEigDecomp encapsulates the eigenvalues and eigenvectors of a Hermitian 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 RWHermEigServer for details.
Synopsis
#include <rw/lapack/hermeig.h> // RWHermEigDecomp<T>
RWHermEigDecomp<DComplex> eig(A); // A is an RWHermMat<DComplex>
Encapsulates the eigenvalues and eigenvectors of a Hermitian matrix.
Definition hermeig.h:80
Example
#include <rw/lapack/hermeig.h>
#include <iostream>
int main() {
std::cin >> A;
std::cout << "eigenvalues: " << eig.eigenValues() << std::endl;
std::cout << "eigenvectors: " << eig.eigenVectors() << std::endl;
return 0;
}
Encapsulates a Hermitian matrix.
Definition hermmat.h:118

Constructor & Destructor Documentation

◆ RWHermEigDecomp() [1/4]

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

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

◆ RWHermEigDecomp() [2/4]

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.

◆ RWHermEigDecomp() [3/4]

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.

◆ RWHermEigDecomp() [4/4]

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

Creates a copy of the passed value.

Member Function Documentation

◆ cols()

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

Returns the number of columns in the decomposed matrix.

◆ eigenValue()

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

Returns the i th eigenvalue.

◆ eigenValues()

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

Returns a vector of all computed eigenvalues.

◆ eigenVector()

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

Returns the i th eigenvector.

◆ eigenVectors()

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

Returns a matrix whose columns are the eigenvectors.

◆ factor() [1/2]

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.

◆ factor() [2/2]

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.

◆ fail()

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.

◆ good()

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

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

◆ inaccurate()

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.

◆ numEigenValues()

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

Returns the number of eigenvalues in this object.

◆ numEigenVectors()

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

Returns the number of eigenvectors in this object.

◆ operator=()

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

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

◆ rows()

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