sofa::component::linearsolver::CGLinearSolver< TMatrix, TVector > Class Template Reference

Linear system solver using the conjugate gradient iterative algorithm. More...

#include <CGLinearSolver.h>

Inheritance diagram for sofa::component::linearsolver::CGLinearSolver< TMatrix, TVector >:

Inheritance graph
[legend]
Collaboration diagram for sofa::component::linearsolver::CGLinearSolver< TMatrix, TVector >:

Collaboration graph
[legend]

Public Types

typedef TMatrix Matrix
typedef TVector Vector

Public Member Functions

 CGLinearSolver ()
void solve (Matrix &M, Vector &x, Vector &b)
 Solve Mx=b.
template<>
void cgstep_beta (Vector &p, Vector &r, double beta)
template<>
void cgstep_alpha (Vector &x, Vector &r, Vector &p, Vector &q, double alpha)

Data Fields

Data< unsigned > f_maxIter
Data< double > f_tolerance
Data< double > f_smallDenominatorThreshold
Data< bool > f_verbose

Protected Member Functions

void cgstep_beta (Vector &p, Vector &r, double beta)
 This method is separated from the rest to be able to use custom/optimized versions depending on the types of vectors.
void cgstep_alpha (Vector &x, Vector &r, Vector &p, Vector &q, double alpha)
 This method is separated from the rest to be able to use custom/optimized versions depending on the types of vectors.

Detailed Description

template<class TMatrix, class TVector>
class sofa::component::linearsolver::CGLinearSolver< TMatrix, TVector >

Linear system solver using the conjugate gradient iterative algorithm.

Definition at line 44 of file CGLinearSolver.h.


Member Typedef Documentation

template<class TMatrix , class TVector >
typedef TMatrix sofa::component::linearsolver::CGLinearSolver< TMatrix, TVector >::Matrix

Definition at line 47 of file CGLinearSolver.h.

template<class TMatrix , class TVector >
typedef TVector sofa::component::linearsolver::CGLinearSolver< TMatrix, TVector >::Vector

Definition at line 48 of file CGLinearSolver.h.


Constructor & Destructor Documentation

template<class TMatrix , class TVector >
sofa::component::linearsolver::CGLinearSolver< TMatrix, TVector >::CGLinearSolver (  )  [inline]

Definition at line 54 of file CGLinearSolver.h.


Member Function Documentation

template<>
void sofa::component::linearsolver::CGLinearSolver< simulation::GraphScatteredMatrix, simulation::GraphScatteredVector >::cgstep_alpha ( Vector &  x,
Vector &  r,
Vector &  p,
Vector &  q,
double  alpha 
) [inline]

template<class TMatrix , class TVector >
void sofa::component::linearsolver::CGLinearSolver< TMatrix, TVector >::cgstep_alpha ( Vector &  x,
Vector &  r,
Vector &  p,
Vector &  q,
double  alpha 
) [inline, protected]

This method is separated from the rest to be able to use custom/optimized versions depending on the types of vectors.

It computes: x += p*alpha, r -= q*alpha

Definition at line 185 of file CGLinearSolver.h.

Referenced by sofa::component::linearsolver::CGLinearSolver< TMatrix, TVector >::solve().

template<>
void sofa::component::linearsolver::CGLinearSolver< simulation::GraphScatteredMatrix, simulation::GraphScatteredVector >::cgstep_beta ( Vector &  p,
Vector &  r,
double  beta 
) [inline]

Definition at line 192 of file CGLinearSolver.h.

References sofa::simulation::SolverImpl::v_op().

template<class TMatrix , class TVector >
void sofa::component::linearsolver::CGLinearSolver< TMatrix, TVector >::cgstep_beta ( Vector &  p,
Vector &  r,
double  beta 
) [inline, protected]

This method is separated from the rest to be able to use custom/optimized versions depending on the types of vectors.

It computes: p = p*beta + r

Definition at line 178 of file CGLinearSolver.h.

Referenced by sofa::component::linearsolver::CGLinearSolver< TMatrix, TVector >::solve().

template<class TMatrix , class TVector >
void sofa::component::linearsolver::CGLinearSolver< TMatrix, TVector >::solve ( Matrix &  M,
Vector &  x,
Vector &  b 
) [inline]


Field Documentation

template<class TMatrix , class TVector >
Data<unsigned> sofa::component::linearsolver::CGLinearSolver< TMatrix, TVector >::f_maxIter

template<class TMatrix , class TVector >
Data<double> sofa::component::linearsolver::CGLinearSolver< TMatrix, TVector >::f_smallDenominatorThreshold

template<class TMatrix , class TVector >
Data<double> sofa::component::linearsolver::CGLinearSolver< TMatrix, TVector >::f_tolerance

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


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

Generated on Sun Nov 23 04:20:23 2008 for Sofa by  doxygen 1.5.7.1