 SOFA API  73d8bb95 Open source framework for multi-physics simuation
sofa::component::linearsolver::SVDLinearSolver< TMatrix, TVector > Class Template Reference

`#include <SVDLinearSolver.h>`

Inheritance diagram for sofa::component::linearsolver::SVDLinearSolver< TMatrix, TVector >: [legend]

## Detailed Description

### template<class TMatrix, class TVector> class sofa::component::linearsolver::SVDLinearSolver< TMatrix, TVector >

Linear system solver using the JacobiSVD decomposition of the Eigen library (http://eigen.tuxfamily.org/ , see also an excellent introduction in Numerical Recipes.) The Singular Value Decomposition is probably the most robust (and the slowest !) matrix factoring for linear equation solution. It works only for dense matrices (FullMatrix). The equation system Ax=b is solved using a decomposition of A=USV^T, where U is a n-by-n unitary, V is a p-by-p unitary, and S is a n-by-p real positive matrix which is zero outside of its main diagonal; the diagonal entries of S are known as the singular values of A and the columns of U and V are known as the left and right singular vectors of A respectively. In case of indefinite matrix, there is at least one null singular value, and there is no solution to the equation system except for special right-hand terms. The SVD solver solves the equation in the least-square sense: it finds the pseudo-solution x which minimizes Ax-b. The condition number of the matrix is a byproduct of the solution, written in attribute "conditionNumber" by method solve (Matrix& M, Vector& x, Vector& b).

## Public Attributes

Data< boolf_verbose
Dump system state at each iteration. More...

Data< Realf_minSingularValue
Thershold under which a singular value is set to 0, for the stabilization of ill-conditioned system. More...

Data< Realf_conditionNumber
Condition number of the matrix: ratio between the largest and smallest singular values. Computed in method solve. More...

## Public Member Functions

SOFA_CLASS (SOFA_TEMPLATE2(SVDLinearSolver, TMatrix, TVector), SOFA_TEMPLATE2(sofa::component::linearsolver::MatrixLinearSolver, TMatrix, TVector))

void solve (Matrix &M, Vector &x, Vector &b) override
Solve Mx=b. More...

## Protected Member Functions

SVDLinearSolver ()

## Attribute details

template<class TMatrix , class TVector >
 Data sofa::component::linearsolver::SVDLinearSolver< TMatrix, TVector >::f_conditionNumber

Condition number of the matrix: ratio between the largest and smallest singular values. Computed in method solve.

template<class TMatrix , class TVector >
 Data sofa::component::linearsolver::SVDLinearSolver< TMatrix, TVector >::f_minSingularValue

Thershold under which a singular value is set to 0, for the stabilization of ill-conditioned system.

template<class TMatrix , class TVector >
 Data sofa::component::linearsolver::SVDLinearSolver< TMatrix, TVector >::f_verbose

Dump system state at each iteration.

## Constructor details

template<class TMatrix , class TVector >
 sofa::component::linearsolver::SVDLinearSolver< TMatrix, TVector >::SVDLinearSolver ( )
protected

## Function details

template<class TMatrix , class TVector >
 sofa::component::linearsolver::SVDLinearSolver< TMatrix, TVector >::SOFA_CLASS ( SOFA_TEMPLATE2(SVDLinearSolver< TMatrix, TVector >, TMatrix, TVector) , SOFA_TEMPLATE2(sofa::component::linearsolver::MatrixLinearSolver, TMatrix, TVector) )
template<class TMatrix , class TVector >
 void sofa::component::linearsolver::SVDLinearSolver< TMatrix, TVector >::solve ( Matrix & M, Vector & x, Vector & b )
override

Solve Mx=b.