Belos::IterativeSolver< ScalarType, MV, OP > Class Template Reference

The Belos::IterativeSolver is a templated virtual base class that defines the basic interface that any linear solver will support. More...

#include <BelosIterativeSolver.hpp>

Inheritance diagram for Belos::IterativeSolver< ScalarType, MV, OP >:

Inheritance graph
[legend]
List of all members.

Public Member Functions

Constructor/Destructor.
 IterativeSolver (void)
 Default Constructor.
virtual ~IterativeSolver (void)
 Destructor.
Accessor methods
virtual int GetNumIters () const =0
 Get the current iteration count for this block of linear systems.
virtual int GetNumRestarts () const =0
 Get the current restart count of the iteration method.
virtual RefCountPtr< const
MV > 
GetNativeResiduals (std::vector< MagnitudeType > *normvec) const =0
 Get the solvers native residuals for the current block of linear systems.
virtual RefCountPtr< MV > GetCurrentSoln ()=0
 Get the actual residual vectors for the current block of linear systems.
virtual RefCountPtr< LinearProblem<
ScalarType, MV, OP > > 
GetLinearProblem () const =0
 Get a constant reference to the current linear problem, which may include a current solution.
virtual RefCountPtr< StatusTest<
ScalarType, MV, OP > > 
GetStatusTest () const =0
Reset methods
virtual int Reset (const RefCountPtr< ParameterList > &pl=Teuchos::null)
 Reset the solver to its initialized state. This is not a required method for all solvers, but a method that should be implemented by any solver whos object maintains state information. The reset method is used to reset a solver object so it can then be reused, i.e. in inner-outer iterations. An optional parameter list can be passed in to change any solver parameters necessary.
Solve method
virtual void Solve ()=0
 Use the iterative method prescribed by the solver to compute the solution to the linear problem.

Detailed Description

template<class ScalarType, class MV, class OP>
class Belos::IterativeSolver< ScalarType, MV, OP >

The Belos::IterativeSolver is a templated virtual base class that defines the basic interface that any linear solver will support.

The Belos::IterativeSolver class is responsible for providing the current solver information to the Belos::StatusTest object.

Definition at line 62 of file BelosIterativeSolver.hpp.


Constructor & Destructor Documentation

template<class ScalarType, class MV, class OP>
Belos::IterativeSolver< ScalarType, MV, OP >::IterativeSolver void   )  [inline]
 

Default Constructor.

Definition at line 73 of file BelosIterativeSolver.hpp.

template<class ScalarType, class MV, class OP>
virtual Belos::IterativeSolver< ScalarType, MV, OP >::~IterativeSolver void   )  [inline, virtual]
 

Destructor.

Definition at line 76 of file BelosIterativeSolver.hpp.


Member Function Documentation

template<class ScalarType, class MV, class OP>
virtual int Belos::IterativeSolver< ScalarType, MV, OP >::GetNumIters  )  const [pure virtual]
 

Get the current iteration count for this block of linear systems.

Implemented in Belos::BlockCG< ScalarType, MV, OP >, Belos::BlockGmres< ScalarType, MV, OP >, Belos::CG< ScalarType, MV, OP >, and Belos::TFQMR< ScalarType, MV, OP >.

template<class ScalarType, class MV, class OP>
virtual int Belos::IterativeSolver< ScalarType, MV, OP >::GetNumRestarts  )  const [pure virtual]
 

Get the current restart count of the iteration method.

Some linear solvers can perform restarts (i.e. GMRES) to reduce memory and orthogonalization costs. For other linear solvers that don't perform restarts (i.e. CG), this is not a valid stopping criteria.

Implemented in Belos::BlockCG< ScalarType, MV, OP >, Belos::BlockGmres< ScalarType, MV, OP >, Belos::CG< ScalarType, MV, OP >, and Belos::TFQMR< ScalarType, MV, OP >.

template<class ScalarType, class MV, class OP>
virtual RefCountPtr<const MV> Belos::IterativeSolver< ScalarType, MV, OP >::GetNativeResiduals std::vector< MagnitudeType > *  normvec  )  const [pure virtual]
 

Get the solvers native residuals for the current block of linear systems.

This is not be the same as the true residual for most solvers. Sometimes the native residuals are not in multivector form, so the norm type is solver dependent. If the true residual is required, then call GetCurrentSoln().

Note:
  1. If the native residual is in multivector form then a non-null pointer will be returned, else the normvec will be populated with the current residual norms.
  2. If the native residual is returned in multivector form, the memory is managed by the calling routine.

Implemented in Belos::BlockCG< ScalarType, MV, OP >, Belos::BlockGmres< ScalarType, MV, OP >, Belos::CG< ScalarType, MV, OP >, and Belos::TFQMR< ScalarType, MV, OP >.

template<class ScalarType, class MV, class OP>
virtual RefCountPtr<MV> Belos::IterativeSolver< ScalarType, MV, OP >::GetCurrentSoln  )  [pure virtual]
 

Get the actual residual vectors for the current block of linear systems.

This may force the solver to compute a current residual for its linear systems. Some linear solvers don't constantly update their residuals and solutions (i.e. GMRES), so this may be an expensive request. Using true residuals to determine convergence should be secondary to using the native residuals of the iterative linear solver.

Note:
The memory of the returned multivector is managed by the calling routine.

Implemented in Belos::BlockCG< ScalarType, MV, OP >, Belos::BlockGmres< ScalarType, MV, OP >, Belos::CG< ScalarType, MV, OP >, and Belos::TFQMR< ScalarType, MV, OP >.

template<class ScalarType, class MV, class OP>
virtual RefCountPtr<LinearProblem<ScalarType,MV,OP> > Belos::IterativeSolver< ScalarType, MV, OP >::GetLinearProblem  )  const [pure virtual]
 

Get a constant reference to the current linear problem, which may include a current solution.

Implemented in Belos::BlockCG< ScalarType, MV, OP >, Belos::BlockGmres< ScalarType, MV, OP >, Belos::CG< ScalarType, MV, OP >, and Belos::TFQMR< ScalarType, MV, OP >.

template<class ScalarType, class MV, class OP>
virtual RefCountPtr<StatusTest<ScalarType,MV,OP> > Belos::IterativeSolver< ScalarType, MV, OP >::GetStatusTest  )  const [pure virtual]
 

Implemented in Belos::BlockCG< ScalarType, MV, OP >, Belos::BlockGmres< ScalarType, MV, OP >, Belos::CG< ScalarType, MV, OP >, and Belos::TFQMR< ScalarType, MV, OP >.

template<class ScalarType, class MV, class OP>
virtual int Belos::IterativeSolver< ScalarType, MV, OP >::Reset const RefCountPtr< ParameterList > &  pl = Teuchos::null  )  [inline, virtual]
 

Reset the solver to its initialized state. This is not a required method for all solvers, but a method that should be implemented by any solver whos object maintains state information. The reset method is used to reset a solver object so it can then be reused, i.e. in inner-outer iterations. An optional parameter list can be passed in to change any solver parameters necessary.

Note:
This method can ONLY be expected to reset the solver object's state, the LinearProblem and StatusTest need to be reset separately.

Reimplemented in Belos::BlockGmres< ScalarType, MV, OP >.

Definition at line 140 of file BelosIterativeSolver.hpp.

template<class ScalarType, class MV, class OP>
virtual void Belos::IterativeSolver< ScalarType, MV, OP >::Solve  )  [pure virtual]
 

Use the iterative method prescribed by the solver to compute the solution to the linear problem.

Implemented in Belos::BlockCG< ScalarType, MV, OP >, Belos::BlockGmres< ScalarType, MV, OP >, Belos::CG< ScalarType, MV, OP >, and Belos::TFQMR< ScalarType, MV, OP >.


The documentation for this class was generated from the following file:
Generated on Thu Sep 18 12:30:13 2008 for Belos by doxygen 1.3.9.1