Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

SVD Class Reference

#include <svd.h>

List of all members.


Detailed Description

The SVD class performs singular value decomposition on TNT matricies.

It can also solve systems of linear equations using the SVD method. In doing so it eliminates small singular values to improve matrix conditioning.

Todo:
Perhaps the SVD class could keep a local copy of the decomposition for the last matrix decomposed and repeatedly use it in a solver function which only passes the vector to be solved for.

Definition at line 40 of file svd.h.

Public Member Functions

 SVD (int l=CONVERGE_LIMIT)
 Constructor.

bool compute (TNT::Matrix< double > &A, TNT::Vector< double > &W, TNT::Matrix< double > &V)
 Computes SVD using TNT Matrices.

void solve (TNT::Matrix< double > &U, TNT::Vector< double > &W, TNT::Matrix< double > &V, TNT::Vector< double > b, TNT::Vector< double > &x)
 Solves a system of equations using SVD components.

bool solve (TNT::Matrix< double > A, TNT::Vector< double > &x, TNT::Vector< double > b)
 Solves a system of equations.


Private Member Functions

double pythag (double a, double b)
 Computes sqrt(a^2 + b^2 ).

void condition (TNT::Vector< double > &w)
 Fixes ill-conditioning by removing small singular values.


Private Attributes

int limit
 Maximum number of iterations for convergance.


Constructor & Destructor Documentation

SVD::SVD int  l = CONVERGE_LIMIT  )  [inline]
 

Constructor.

Parameters:
l Iteration limit for convergance.

Definition at line 58 of file svd.h.

References limit.


Member Function Documentation

bool SVD::compute TNT::Matrix< double > &  a,
TNT::Vector< double > &  w,
TNT::Matrix< double > &  v
 

Computes SVD using TNT Matrices.

Parameters:
a Matrix to decompose (replaced by orthogonal matrix U).
w Vector of singular values (actually a diagonal matrix).
v Orthogonal matrix V.
Note:
Orthogonal matrix U is returned in a!
Returns:
False if convergance fails.

Definition at line 93 of file svd.cpp.

References FMAX, IMIN, limit, pythag(), and SIGN.

Referenced by solve().

void SVD::condition TNT::Vector< double > &  w  )  [private]
 

Fixes ill-conditioning by removing small singular values.

Parameters:
w Singular value vector to be conditioned.

Definition at line 33 of file svd.cpp.

Referenced by solve().

double SVD::pythag double  a,
double  b
[private]
 

Computes sqrt(a^2 + b^2 ).

No destructive underflow or overflow.

Definition at line 16 of file svd.cpp.

References SQR.

Referenced by compute().

bool SVD::solve TNT::Matrix< double >  A,
TNT::Vector< double > &  x,
TNT::Vector< double >  b
 

Solves a system of equations.

Parameters:
A Matrix of coefficients.
x Vector of variables.
b Solution vector.
Returns:
False if SVD did not converge, true otherwise

Definition at line 323 of file svd.cpp.

References compute(), condition(), and solve().

void SVD::solve TNT::Matrix< double > &  u,
TNT::Vector< double > &  w,
TNT::Matrix< double > &  v,
TNT::Vector< double >  b,
TNT::Vector< double > &  x
 

Solves a system of equations using SVD components.

Parameters:
u Orthogonal SVD matrix U.
w Singular value vector W.
v Orthogonal SVD matrix V.
b Solution vector.
x Variable vector.

Definition at line 287 of file svd.cpp.

Referenced by SurfacePropagation::applyConstraint(), Implicit::interpolate(), and solve().


Member Data Documentation

int SVD::limit [private]
 

Maximum number of iterations for convergance.

Definition at line 44 of file svd.h.

Referenced by compute(), and SVD().


The documentation for this class was generated from the following files:
Generated on Mon Jun 28 15:03:20 2004 for Advanced Surface Library by doxygen 1.3.4