CVR-Lib last update 20 Sep 2009

cvr::symmetricEigenSystem< T > Class Template Reference
[Linear AlgebraStatistics]

Computes the Eigenvectors and Eigenvalues of a symmetric, positive definite, real matrix. More...

#include <cvrSymmetricEigenSystem.h>

Inheritance diagram for cvr::symmetricEigenSystem< T >:

Inheritance graph
[legend]
Collaboration diagram for cvr::symmetricEigenSystem< T >:

Collaboration graph
[legend]

List of all members.

Classes

class  parameters
 eigenSystem parameter class More...

Public Member Functions

 symmetricEigenSystem ()
 symmetricEigenSystem (const parameters &params)
virtual bool apply (const matrix< T > &theMatrix, vector< T > &eigenvalues, matrix< T > &eigenvectors) const
virtual bool reducedEigenSystem (const matrix< T > &theMatrix, vector< T > &eigenvalues, matrix< T > &eigenvectors, const int dimensions) const
const std::string & name () const
virtual symmetricEigenSystemclone () const
virtual symmetricEigenSystemnewInstance () const
const parametersgetParameters () const


Detailed Description

template<typename T>
class cvr::symmetricEigenSystem< T >

Computes the Eigenvectors and Eigenvalues of a symmetric, positive definite, real matrix.

The most common source of such matrices is a covariance matrix (see cvr::secondOrderStatistics).

This class uses the LAPACK functions by default if they are installed on your system. Otherwise a simple Jacobi algorithm is used. This can also be chosen deliberately by setting parameters::useLapack to false.

The eigenvectors can be sorted according to their eigenvalues by setting parameters::sort. A fixed number of eigenvectors can be set via parameters::dimension. For LAPACK this also reduces computation time.

Please note that the eigenvector matrices will contain the eigenvectors in the COLUMNS and not in the rows, as could be expected. This avoids the requirement of transposing matrices in eigenvector-based transformations like PCA!

,


Constructor & Destructor Documentation

template<typename T >
cvr::symmetricEigenSystem< T >::symmetricEigenSystem (  ) 

Default constructor.

template<typename T >
cvr::symmetricEigenSystem< T >::symmetricEigenSystem ( const parameters params  ) 

Default constructor with parameters.


Member Function Documentation

template<typename T >
virtual bool cvr::symmetricEigenSystem< T >::apply ( const matrix< T > &  theMatrix,
vector< T > &  eigenvalues,
matrix< T > &  eigenvectors 
) const [virtual]

Calculate the Eigensystem with eigenvalues and eigenvalues from the given data in theMatrix (Samples in rows).

Due to the symmetricity of the data it suffices if theMatrix is upper triangular.

Parameters:
theMatrix Real symmetric matrix to be transformed. Only the diagonal and above diagonal elements have to be set.
eigenvalues Elements will contain the eigenvalues.
eigenvectors Columns will contain the eigenvectors corresponding to the eigenvalues. returns true if successful, false otherwise.

template<typename T >
virtual symmetricEigenSystem* cvr::symmetricEigenSystem< T >::clone (  )  const [virtual]

Returns a pointer to a clone of this functor.

Implements cvr::functor.

template<typename T >
const parameters& cvr::symmetricEigenSystem< T >::getParameters (  )  const

returns the current parameters.

Reimplemented from cvr::linearAlgebraFunctor.

template<typename T >
const std::string& cvr::symmetricEigenSystem< T >::name (  )  const [virtual]

Returns the name of this class.

Reimplemented from cvr::lapackInterface.

template<typename T >
virtual symmetricEigenSystem* cvr::symmetricEigenSystem< T >::newInstance (  )  const [virtual]

Returns a pointer to a new instance of this functor.

Implements cvr::functor.

template<typename T >
virtual bool cvr::symmetricEigenSystem< T >::reducedEigenSystem ( const matrix< T > &  theMatrix,
vector< T > &  eigenvalues,
matrix< T > &  eigenvectors,
const int  dimensions 
) const [virtual]

Convenience function that calculates the Eigensystem like apply, but uses the given argument dimensions instead of those given in parameters::dimensions.

Parameters:
theMatrix Real symmetric matrix to be transformed. Only the diagonal and above diagonal elements have to be set.
eigenvalues Elements will contain the eigenvalues.
eigenvectors Columns will contain the eigenvectors corresponding to the eigenvalues.
dimensions number of dimensions in eigenspace returns true if successful, false otherwise.


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

Generated on Sun Sep 20 22:09:05 2009 for CVR-Lib by Doxygen 1.5.8