KrisLibrary  1.0.0
Public Types | Public Member Functions | Public Attributes | List of all members
Math::SVDecomposition< T > Class Template Reference

Performs the singular value decomposition. More...

#include <SVDecomposition.h>

Public Types

typedef MatrixTemplate< T > MatrixT
 
typedef VectorTemplate< T > VectorT
 
typedef DiagonalMatrixTemplate< T > DiagonalMatrixT
 

Public Member Functions

 SVDecomposition (const MatrixT &A)
 
bool set (const MatrixT &A)
 
void setIdentity (int m, int n)
 
void setZero (int m, int n)
 
void resize (int m, int n)
 
void clear ()
 
void backSub (const VectorT &b, VectorT &x) const
 
void dampedBackSub (const VectorT &b, T lambda, VectorT &x) const
 
void nullspaceComponent (const VectorT &x, VectorT &xNull) const
 
int getRank () const
 
int getNull () const
 
void getInverse (MatrixT &Ainv) const
 
void getDampedPseudoInverse (MatrixT &Aplus, T lambda) const
 
void getNullspace (MatrixT &N) const
 
void sortSVs ()
 sorts the singular values from highest to lowest
 

Public Attributes

MatrixT U
 
DiagonalMatrixT W
 
MatrixT V
 
int maxIters
 
epsilon
 

Detailed Description

template<class T>
class Math::SVDecomposition< T >

Performs the singular value decomposition.

Decomposes the matrix A to UWV^t. The values in the diagonal matrix W are the singular values. The backsubstitution functions can either ignore zero singular values (within tolerance epsilon) or used a "damped" backsubstitution where W is replaced with W+lambda*I.

The nullspace matrix is the matrix N such that for each column n, A*n = 0.


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