latest version v1.9 - last update 10 Apr 2010 |
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>
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 |
unifiedSVD & | copy (const unifiedSVD &other) |
unifiedSVD & | operator= (const unifiedSVD &other) |
virtual functor * | clone () const |
virtual bool | updateParameters () |
const parameters & | getParameters () 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 |
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.
lti::unifiedSVD< T >::unifiedSVD | ( | ) |
default constructor
lti::unifiedSVD< T >::unifiedSVD | ( | const parameters & | par | ) |
Construct a functor using the given parameters.
lti::unifiedSVD< T >::unifiedSVD | ( | const unifiedSVD< T > & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::unifiedSVD< T >::~unifiedSVD | ( | ) | [virtual] |
destructor
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.
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 |
References lti::unifiedSVD< T >::svd.
bool lti::unifiedSVD< T >::apply | ( | matrix< T > & | src, | |
vector< T > & | w, | |||
matrix< T > & | v | |||
) | const [inline] |
OnPlace version of Singular Value Decomposition.
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 |
References lti::unifiedSVD< T >::svd.
virtual functor* lti::unifiedSVD< T >::clone | ( | ) | const [virtual] |
returns a pointer to a clone of this functor.
Implements lti::functor.
unifiedSVD& lti::unifiedSVD< T >::copy | ( | const unifiedSVD< T > & | other | ) |
copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::functor.
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'.
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 |
References lti::unifiedSVD< T >::svd.
const parameters& lti::unifiedSVD< T >::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::functor.
virtual const char* lti::unifiedSVD< T >::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("unifiedSVD")
Reimplemented from lti::linearAlgebraFunctor.
unifiedSVD& lti::unifiedSVD< T >::operator= | ( | const unifiedSVD< T > & | other | ) |
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.
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. |
Reimplemented from lti::functor.
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!
Reimplemented from lti::functor.
singularValueDecomp<T>* lti::unifiedSVD< T >::svd [protected] |
The actual eigenSystem.
Referenced by lti::unifiedSVD< T >::apply(), and lti::unifiedSVD< T >::decomposition().