LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::unifiedSVD< T > Class Template Reference

This functor is meant to be used for calculating the Singular Vector Decomposition without need to think about the most efficient usage of the available methods. More...

#include <ltiUnifiedSVD.h>

Inheritance diagram for lti::unifiedSVD< T >:
Inheritance graph
[legend]
Collaboration diagram for lti::unifiedSVD< T >:
Collaboration graph
[legend]

List of all members.

Classes

class  parameters
 the parameters for the class unifiedSVD More...

Public Member Functions

 unifiedSVD ()
 unifiedSVD (const parameters &par)
 unifiedSVD (const unifiedSVD &other)
virtual ~unifiedSVD ()
virtual const char * getTypeName () const
unifiedSVDcopy (const unifiedSVD &other)
unifiedSVDoperator= (const unifiedSVD &other)
virtual functorclone () const
virtual bool updateParameters ()
const parametersgetParameters () const
virtual bool read (ioHandler &handler, const bool complete=true)
bool decomposition (matrix< T > &src, vector< T > &w, matrix< T > &v) const
bool apply (matrix< T > &src, vector< T > &w, matrix< T > &v) const
bool apply (const matrix< T > &src, matrix< T > &u, vector< T > &w, matrix< T > &v) const

Protected Attributes

singularValueDecomp< T > * svd

Detailed Description

template<class T>
class lti::unifiedSVD< T >

This functor is meant to be used for calculating the Singular Vector Decomposition without need to think about the most efficient usage of the available methods.

If the LAPACK is available it will automatically be used since it is much faster.

It is preferred to use this class instead of the SVD functors available.


Constructor & Destructor Documentation

template<class T >
lti::unifiedSVD< T >::unifiedSVD (  ) 

default constructor

template<class T >
lti::unifiedSVD< T >::unifiedSVD ( const parameters par  ) 

Construct a functor using the given parameters.

template<class T >
lti::unifiedSVD< T >::unifiedSVD ( const unifiedSVD< T > &  other  ) 

copy constructor

Parameters:
other the object to be copied
template<class T >
virtual lti::unifiedSVD< T >::~unifiedSVD (  )  [virtual]

destructor


Member Function Documentation

template<class T >
bool lti::unifiedSVD< T >::apply ( const matrix< T > &  src,
matrix< T > &  u,
vector< T > &  w,
matrix< T > &  v 
) const [inline]

OnCopy version of Singular Value Decomposition.

Parameters:
src matrix<T> with the source matrix
u the U matrix
w vector<T> with the singular values, sorted descendingly if parameters::sort is true. The elements of this vector constitute the diagonal of the W matrix.
v the V matrix
Returns:
true is the decomposition was successfull, false if an error occured

References lti::unifiedSVD< T >::svd.

template<class T >
bool lti::unifiedSVD< T >::apply ( matrix< T > &  src,
vector< T > &  w,
matrix< T > &  v 
) const [inline]

OnPlace version of Singular Value Decomposition.

Parameters:
src matrix<T> with the source matrix, will also contain the U matrix after the function has returned.
w vector<T> with the singular values, sorted descendingly if parameters::sort is true. The elements of this vector constitute the diagonal of the W matrix.
v the V matrix
Returns:
true is the decomposition was successfull, false if an error occured

References lti::unifiedSVD< T >::svd.

template<class T >
virtual functor* lti::unifiedSVD< T >::clone (  )  const [virtual]

returns a pointer to a clone of this functor.

Implements lti::functor.

template<class T >
unifiedSVD& lti::unifiedSVD< T >::copy ( const unifiedSVD< T > &  other  ) 

copy data of "other" functor.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::functor.

template<class T >
bool lti::unifiedSVD< T >::decomposition ( matrix< T > &  src,
vector< T > &  w,
matrix< T > &  v 
) const [inline]

OnPlace version of Singular Value Decomposition.

Singular Value Decomposition means that a m*n-matrix A is decomposed into three matrices U,W,V, such that A = U*W*V'. U is m*n, W is a diagonal matrix with n elements (which is implemented as vector), V is a n*n-matrix. Note that the function returns V, not V'.

Parameters:
src matrix<T> with the source matrix, will also contain the U matrix after the function has returned. If src is a m*n matrix, U will also be of size m*n
w vector<T> with the singular values, sorted descendingly The elements of this vector constitute the diagonal of the W matrix.
v the V matrix
Returns:
true is the decomposition was successfull, false if an error occured

References lti::unifiedSVD< T >::svd.

template<class T >
const parameters& lti::unifiedSVD< T >::getParameters (  )  const

returns used parameters

Reimplemented from lti::functor.

template<class T >
virtual const char* lti::unifiedSVD< T >::getTypeName (  )  const [virtual]

returns the name of this type ("unifiedSVD")

Reimplemented from lti::linearAlgebraFunctor.

template<class T >
unifiedSVD& lti::unifiedSVD< T >::operator= ( const unifiedSVD< T > &  other  ) 

alias for copy member

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::functor.

template<class T >
virtual bool lti::unifiedSVD< T >::read ( ioHandler handler,
const bool  complete = true 
) [virtual]

Read the functor from the given ioHandler.

This method automatically sets the correct SVD solver that is given in the parameters and transfers the relevant parameters to that functor.

Parameters:
handler the ioHandler to be used
complete if true (the default) the enclosing begin/end will be also written, otherwise only the data block will be written.
Returns:
true if write was successful

Reimplemented from lti::functor.

template<class T >
virtual bool lti::unifiedSVD< T >::updateParameters (  )  [virtual]

set functor's parameters.

This member makes a copy of theParam: the functor will keep its own copy of the parameters!

Returns:
true if successful, false otherwise

Reimplemented from lti::functor.


Member Data Documentation

template<class T >
singularValueDecomp<T>* lti::unifiedSVD< T >::svd [protected]

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

Generated on Sat Apr 10 15:28:49 2010 for LTI-Lib by Doxygen 1.6.1