ltl::SVDecomposition< T > Class Template Reference
[Singular Value Decomposition]

List of all members.

Static Public Member Functions

Static Protected Member Functions


Detailed Description

template<typename T>
class ltl::SVDecomposition< T >

Perform Singular Value Decomposition and solve linear systems. Adapted from Numerical Recipes.

Example:

      FVector<double,4> x(2.);  // target

      FMatrix<double,4,4> A;    // the matrix
      A = 1., 2.,  3.,  2.,
          5., 11., 7.,  13.,
          9., 7.,  5.,  1.,
          7., 13., 17., 11.;
      FVector<double,4> b(dot(A, x));   // construct b

      x = 0.;
      x = SVDecomposition<double>::solve(A, B);   // solve Ax = b
      // x should be [2,2].

Member Function Documentation

template<typename T>
template<int M, int N>
FVector< T, N > ltl::SVDecomposition< T >::solve ( FMatrix< T, M, N >  A,
const FVector< T, M > &  b 
) [inline, static]

Given A[m][n], b[m], solves A x = b using SVD. returns solution vector x[n] No input quantities are changed.

template<typename T>
template<int M, int N>
FVector< T, N > ltl::SVDecomposition< T >::svbksb ( const FMatrix< T, M, N > &  U,
const FVector< T, N > &  W,
const FMatrix< T, N, N > &  V,
const FVector< T, M > &  b 
) [inline, static]

Given A[m][n], b[m], solves A x = b in the SVD form U W V'x = b so x = V U'b/W U[m][n], W[n][n] and V[n][n] No input quantities are changed.

template<typename T>
template<int M, int N>
void ltl::SVDecomposition< T >::svdcmp ( FMatrix< T, M, N > &  A,
FVector< T, N > &  W,
FMatrix< T, N, N > &  V 
) [inline, static]

Given matrix A[m][n], m>=n, using svd decomposition A = U W V' to get U[m][n], W[n][n] and V[n][n], where U occupies the position of A. NOTE: if m<n, A should be filled up to square with zero rows. A[m][n] has been destroyed by U[m][n] after the decomposition.

template<typename T>
static T ltl::SVDecomposition< T >::pythag ( const T  a,
const T  b 
) [inline, static, protected]

Computes (a^2 + b^2)^1/2 without destructive underflow or overflow


Generated on Wed Mar 11 17:44:36 2009 for LTL by  doxygen 1.5.3