Public Member Functions | Protected Member Functions | Protected Attributes
rtc::EigenSystem< T, M > Class Template Reference

#include <rtcEigenSystem.h>

List of all members.

Public Member Functions

void balance ()
void eigenSort (Vec< T, M > &d, SMat< T, M > &v)
 EigenSystem (SMat< T, M > &a_)
void hessenbergReduce ()
void householderReduce (Vec< T, M > &d, Vec< T, M > &e, bool vecs=true)
void householderSolve (Vec< T, M > &d, Vec< T, M > &e, bool vecs=true)
bool jacobi (Vec< T, M > &eigenvalues, SMat< T, M > &eigenvectors, int *nrot)
bool jacobi (Vec< T, M > &eigenvalues, SMat< T, M > &eigenvectors)
void qr (Vec< T, M > &wreal, Vec< T, M > &wimag)
 ~EigenSystem ()

Protected Member Functions

void rotate (double &g, double &h, SMat< T, M > &a, const int i, const int j, const int k, const int l, const double s, const double tau) const
void rotateT (double &g, double &h, SMat< T, M > &a, const int i, const int j, const int k, const int l, const double s, const double tau) const

Protected Attributes

SMat< T, M > & a

Detailed Description

template<class T, int M>
class rtc::EigenSystem< T, M >

Eigen Value/Vector System, a composition of SMat<T,M> and Vec<T,M>

All methods have been vetted against each other but not compared to external references like Matlab. Also, there has been no test of challenging matrices, only random, well-conditioned ones. Since these methods have all been taken from Numerical Recipes for C (online), they should all function well. However, I've parsed all but the QR algorithm into 0-based index referencing (I put a wrapper on QR because the internal indexing was too complicated), so there is a possibility that some mistakes were made in this transcription (unlikely, however, since they appear to work.

Definition at line 60 of file rtcEigenSystem.h.


Constructor & Destructor Documentation

template<class T , int M>
rtc::EigenSystem< T, M >::EigenSystem ( SMat< T, M > &  a_) [inline]

Ctor that accepts system matrix.

Definition at line 105 of file rtcEigenSystem.h.

template<class T , int M>
rtc::EigenSystem< T, M >::~EigenSystem ( ) [inline]

Dtor to delete memory and indicate conclusion

Definition at line 111 of file rtcEigenSystem.h.


Member Function Documentation

template<class T , int M>
void rtc::EigenSystem< T, M >::balance ( ) [inline]

Balance an unbalanced non-symmetric real-valued matrix. Taken from Numerical Recipes in C.

Definition at line 423 of file rtcEigenSystem.h.

template<class T , int M>
void rtc::EigenSystem< T, M >::eigenSort ( Vec< T, M > &  d,
SMat< T, M > &  v 
) [inline]

Sorts eigenvalues (and corresponding eigenvectors) into descending order by straight insertion. Taken from Numerical Recipes in C.

Returns:
d is the vector of eigenvalues (e.g., from jacobi())
v is the matrix of eigenvectors

Definition at line 398 of file rtcEigenSystem.h.

template<class T , int M>
void rtc::EigenSystem< T, M >::hessenbergReduce ( ) [inline]

Reduce to Hessenberg form, for real non-symmetric matrices. Best to run EigenSystem<T,M>::balance() first, though not required. Taken from Numerical Recipes in C.

Definition at line 465 of file rtcEigenSystem.h.

template<class T , int M>
void rtc::EigenSystem< T, M >::householderReduce ( Vec< T, M > &  d,
Vec< T, M > &  e,
bool  vecs = true 
) [inline]

Householder reduction of real, symmetric matrices. Taken from Numerical Recipes in C.

Returns:
d is diagonal of tri-diagonal matrix output
e is the off-diagonal with e(0) = 0.
*nrot is the number of Jacobi rotations required

Definition at line 234 of file rtcEigenSystem.h.

template<class T , int M>
void rtc::EigenSystem< T, M >::householderSolve ( Vec< T, M > &  d,
Vec< T, M > &  e,
bool  vecs = true 
) [inline]

Householder Eigenvector Solve of real, symmetric matrices. Taken from Numerical Recipes in C.

Parameters:
dis the diagonal from householderReduce()
eis the off-diagonal from householderReduce()
vecsshould be set if eigenvectors are wanted

Definition at line 324 of file rtcEigenSystem.h.

template<class T , int M>
bool rtc::EigenSystem< T, M >::jacobi ( Vec< T, M > &  d,
SMat< T, M > &  v,
int *  nrot 
) [inline]

Jacobi method for real symmetric matrices. Taken from Numerical Recipes in C.

Returns:
d is the vector of eigenvalues
v is the matrix whose columns are the corresponding eigenvectors
*nrot is the number of Jacobi rotations required

Definition at line 134 of file rtcEigenSystem.h.

template<class T , int M>
bool rtc::EigenSystem< T, M >::jacobi ( Vec< T, M > &  d,
SMat< T, M > &  v 
) [inline]

Jacobi method for real symmetric matrices. Taken from Numerical Recipes in C.

Returns:
d is the vector of eigenvalues
v is the matrix whose columns are the corresponding eigenvectors

Definition at line 122 of file rtcEigenSystem.h.

template<class T , int M>
void rtc::EigenSystem< T, M >::qr ( Vec< T, M > &  wreal,
Vec< T, M > &  wimag 
) [inline]

Perform a QR Decomposition, for real non-symmetric matrices. Precondition: works on output of hessenbergReduce(). Taken from Numerical Recipes in C.

Definition at line 500 of file rtcEigenSystem.h.

template<class T , int M>
void rtc::EigenSystem< T, M >::rotate ( double &  g,
double &  h,
SMat< T, M > &  a,
const int  i,
const int  j,
const int  k,
const int  l,
const double  s,
const double  tau 
) const [inline, protected]

Definition at line 207 of file rtcEigenSystem.h.

template<class T , int M>
void rtc::EigenSystem< T, M >::rotateT ( double &  g,
double &  h,
SMat< T, M > &  a,
const int  i,
const int  j,
const int  k,
const int  l,
const double  s,
const double  tau 
) const [inline, protected]

Definition at line 217 of file rtcEigenSystem.h.


Member Data Documentation

template<class T, int M>
SMat<T,M>& rtc::EigenSystem< T, M >::a [protected]

Definition at line 91 of file rtcEigenSystem.h.


The documentation for this class was generated from the following file:


rtc
Author(s): Benjamin Pitzer
autogenerated on Mon Oct 6 2014 10:07:35