rwlogo
SourcePro C++ 13.0

SourcePro® C++ API Reference Guide

Product Documentation:

   SourcePro C++
Documentation Home

 All Classes Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
List of all members | Public Member Functions
RWSymEigDecomp< T1 > Class Template Reference

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

#include <rw/lapack/symeig.h>

Public Member Functions

 RWSymEigDecomp ()
 
 RWSymEigDecomp (const RWSymEigDecomp< TypeT > &A)
 
 RWSymEigDecomp (const RWSymMat< TypeT > &A, bool computeVecs=true)
 
 RWSymEigDecomp (const RWSymBandMat< TypeT > &A, bool computeVecs=true)
  More...
 
unsigned cols () const
 
TypeT eigenValue (int i) const
 
const RWMathVec< TypeT > eigenValues () const
 
const RWMathVec< TypeT > eigenVector (int i) const
 
const RWGenMat< TypeT > eigenVectors () const
 
void factor (const RWSymMat< TypeT > &A, bool computeVecs=true)
 
void factor (const RWSymBandMat< TypeT > &A, bool computeVecs=true)
  More...
 
bool fail () const
 
bool good () const
 
bool inaccurate () const
 
unsigned numEigenValues () const
 
unsigned numEigenVectors () const
 
RWSymEigDecomp< TypeT > & operator= (const RWSymEigDecomp< TypeT > &A)
 
unsigned rows () const
 

Detailed Description

template<class T1>
class RWSymEigDecomp< T1 >

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

Synopsis

#include <rw/lapack/symeig.h> // RWSymEigDecomp<T>
RWSymEigDecomp<double> eig(A); // A is an RWSymMat<double>

Example

#include <iostream>
#include <rw/lapack/symeig.h>
int main()
{
std::cin >> A;
std::cout << "eigenvalues: " << eig.eigenValues() << std::endl;
std::cout << "eigenvectors: " << eig.eigenVectors() << std::endl;
return 0;
}

Constructor & Destructor Documentation

template<class T1>
RWSymEigDecomp< T1 >::RWSymEigDecomp ( )

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

template<class T1>
RWSymEigDecomp< T1 >::RWSymEigDecomp ( const RWSymEigDecomp< TypeT > &  A)

Copy and precision conversion constructor. Where possible, data is referenced for efficiency.

template<class T1>
RWSymEigDecomp< T1 >::RWSymEigDecomp ( const RWSymMat< 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 T1>
RWSymEigDecomp< T1 >::RWSymEigDecomp ( const RWSymBandMat< 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 T1>
unsigned RWSymEigDecomp< T1 >::cols ( ) const
inline

Returns the number of columns in the decomposed matrix.

template<class T1>
TypeT RWSymEigDecomp< T1 >::eigenValue ( int  i) const

Returns the i th eigenvalue.

template<class T1>
const RWMathVec<TypeT> RWSymEigDecomp< T1 >::eigenValues ( ) const
inline

Returns a vector of all computed eigenvalues.

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

Returns the i th eigenvector.

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

Returns a matrix whose columns are the eigenvectors.

template<class T1>
void RWSymEigDecomp< T1 >::factor ( const RWSymMat< 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 T1>
void RWSymEigDecomp< T1 >::factor ( const RWSymBandMat< 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 T1>
bool RWSymEigDecomp< T1 >::fail ( ) const

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

template<class T1>
bool RWSymEigDecomp< T1 >::good ( ) const

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

template<class T1>
bool RWSymEigDecomp< T1 >::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 T1>
unsigned RWSymEigDecomp< T1 >::numEigenValues ( ) const
inline

Returns the number of eigenvalues in this object.

template<class T1>
unsigned RWSymEigDecomp< T1 >::numEigenVectors ( ) const
inline

Returns the number of eigenvectors in this object.

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

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

template<class T1>
unsigned RWSymEigDecomp< T1 >::rows ( ) const
inline

Returns the number of rows in the decomposed matrix.


Copyright © 2014 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.
Provide feedback to Rogue Wave about its documentation.