CEDRIC  Revision_backup-2009-02
Public Types | Public Member Functions | Protected Member Functions | List of all members
SVD< ValueType > Class Template Reference

Compute Singular Value Decomposition, Wrapper for super-old Numerical Recipes code. More...

#include <SVD.h>

Public Types

typedef
boost::numeric::ublas::matrix
< ValueType > 
Matrix
 
typedef
boost::numeric::ublas::vector
< ValueType > 
Vector
 

Public Member Functions

 SVD (Matrix &matrix)
 Compute Singular Value Decomposition. More...
 
const Vector & getSingularValues () const
 
const Matrix & getV () const
 

Protected Member Functions

void svdcmp (Matrix &a, Vector &w, Matrix &v)
 

Detailed Description

template<class ValueType>
class SVD< ValueType >

Compute Singular Value Decomposition, Wrapper for super-old Numerical Recipes code.

Member Typedef Documentation

template<class ValueType >
typedef boost::numeric::ublas::matrix<ValueType> SVD< ValueType >::Matrix
template<class ValueType >
typedef boost::numeric::ublas::vector<ValueType> SVD< ValueType >::Vector

Constructor & Destructor Documentation

template<class T >
SVD< T >::SVD ( Matrix &  matrix)

Compute Singular Value Decomposition.

Compute the singular value decomposition of a matrix A into A=UDV'.

Parameters
[in,out]matrixrow-major matrix, gets overwritten by matrix U of decomposition
Note
Input matrix will be destroyed!

References SVD< ValueType >::svdcmp().

Member Function Documentation

template<class ValueType >
const Vector& SVD< ValueType >::getSingularValues ( ) const
inline

Return singular values sorted from largest to smallest.

Returns
singular values sorted from largest to smallest
template<class ValueType >
const Matrix& SVD< ValueType >::getV ( ) const
inline

Return matrix V of decomposition (this is really V and not V transposed).

Returns
matrix V of decomposition
template<class T >
void SVD< T >::svdcmp ( Matrix &  a,
Vector &  w,
Matrix &  v 
)
protected

Given a matrix a[0..m-1][0..n-1], this routine computes its singular value decomposition, A = U · W · V^T. The matrix U replaces a on output.The diagonal matrix of singular values W is output as a vector w[0..n-1]. The matrix V (not the transpose V^T) is output as v[0..n-1][0..n-1].

References FMAX, IMIN, and SIGN.

Referenced by SVD< ValueType >::SVD().