Belos  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | List of all members
Belos::MinresIter< ScalarType, MV, OP > Class Template Reference

MINRES implementation. More...

#include <BelosMinresIter.hpp>

Inheritance diagram for Belos::MinresIter< ScalarType, MV, OP >:
Inheritance graph
[legend]

Public Types

typedef MultiVecTraits
< ScalarType, MV > 
MVT
 
typedef OperatorTraits
< ScalarType, MV, OP > 
OPT
 
typedef Teuchos::ScalarTraits
< ScalarType > 
SCT
 
typedef SCT::magnitudeType MagnitudeType
 
typedef Teuchos::ScalarTraits
< MagnitudeType
SMT
 

Public Member Functions

Constructors/Destructor
 MinresIter (const Teuchos::RCP< LinearProblem< ScalarType, MV, OP > > &problem, const Teuchos::RCP< OutputManager< ScalarType > > &printer, const Teuchos::RCP< StatusTest< ScalarType, MV, OP > > &tester, const Teuchos::ParameterList &params)
 Constructor. More...
 
virtual ~MinresIter ()
 Destructor. More...
 
Solver methods
void iterate ()
 Perform MINRES iterations until convergence or error. More...
 
void initializeMinres (const MinresIterationState< ScalarType, MV > &newstate)
 Initialize the solver to an iterate, providing a complete state. More...
 
void initialize ()
 Initialize the solver. More...
 
MinresIterationState
< ScalarType, MV > 
getState () const
 Get the current state of the linear solver. More...
 
Status methods
int getNumIters () const
 Get the current iteration count. More...
 
void resetNumIters (int iter=0)
 Reset the iteration count. More...
 
Teuchos::RCP< const MV > getNativeResiduals (std::vector< MagnitudeType > *norms) const
 Get the norms of the residuals native to the solver. More...
 
Teuchos::RCP< MV > getCurrentUpdate () const
 Get the current update to the linear system. More...
 
void symOrtho (ScalarType a, ScalarType b, ScalarType *c, ScalarType *s, ScalarType *r)
 
Accessor methods
const LinearProblem
< ScalarType, MV, OP > & 
getProblem () const
 Get a constant reference to the linear problem. More...
 
int getBlockSize () const
 Get the blocksize to be used by the iterative solver in solving this linear problem. More...
 
void setBlockSize (int blockSize)
 Set the blocksize to be used by the iterative solver in solving this linear problem. More...
 
bool isInitialized () const
 States whether the solver has been initialized or not. More...
 
bool isInitialized ()
 States whether the solver has been initialized or not. More...
 
State methods
- Public Member Functions inherited from Belos::Iteration< ScalarType, MV, OP >
 Iteration ()
 Default Constructor. More...
 
virtual ~Iteration ()
 Destructor. More...
 
virtual Teuchos::RCP< const MV > getNativeResiduals (std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > *norms) const =0
 Get the residuals native to the solver. More...
 

Detailed Description

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

MINRES implementation.

Author
Nico Schl"omer

Implementation of the preconditioned Minimal Residual Method (MINRES) iteration. This a bilinear form implementation, that uses inner products of the form <x,My> to solve the preconditioned linear system. Thus, it is necessary that the left preconditioner M is positive definite.

Definition at line 62 of file BelosMinresIter.hpp.

Member Typedef Documentation

template<class ScalarType , class MV , class OP >
typedef MultiVecTraits< ScalarType, MV > Belos::MinresIter< ScalarType, MV, OP >::MVT

Definition at line 69 of file BelosMinresIter.hpp.

template<class ScalarType , class MV , class OP >
typedef OperatorTraits< ScalarType, MV, OP > Belos::MinresIter< ScalarType, MV, OP >::OPT

Definition at line 70 of file BelosMinresIter.hpp.

template<class ScalarType , class MV , class OP >
typedef Teuchos::ScalarTraits< ScalarType > Belos::MinresIter< ScalarType, MV, OP >::SCT

Definition at line 71 of file BelosMinresIter.hpp.

template<class ScalarType , class MV , class OP >
typedef SCT::magnitudeType Belos::MinresIter< ScalarType, MV, OP >::MagnitudeType

Definition at line 72 of file BelosMinresIter.hpp.

template<class ScalarType , class MV , class OP >
typedef Teuchos::ScalarTraits< MagnitudeType > Belos::MinresIter< ScalarType, MV, OP >::SMT

Definition at line 73 of file BelosMinresIter.hpp.

Constructor & Destructor Documentation

template<class ScalarType , class MV , class OP >
Belos::MinresIter< ScalarType, MV, OP >::MinresIter ( const Teuchos::RCP< LinearProblem< ScalarType, MV, OP > > &  problem,
const Teuchos::RCP< OutputManager< ScalarType > > &  printer,
const Teuchos::RCP< StatusTest< ScalarType, MV, OP > > &  tester,
const Teuchos::ParameterList params 
)

Constructor.

problem The linear problem to solve printer Output manager, for intermediate solver output tester Status test for determining when the current approximate solution has converged params Parameter list of solver options

Definition at line 293 of file BelosMinresIter.hpp.

template<class ScalarType , class MV , class OP >
virtual Belos::MinresIter< ScalarType, MV, OP >::~MinresIter ( )
inlinevirtual

Destructor.

Definition at line 92 of file BelosMinresIter.hpp.

Member Function Documentation

template<class ScalarType , class MV , class OP >
void Belos::MinresIter< ScalarType, MV, OP >::iterate ( )
virtual

Perform MINRES iterations until convergence or error.

Perform MINRES iterations until the status test indicates the need to stop, or until an error occurs. In the latter case, a (subclass of) std::exception is thrown.

iterate() will first determine whether the solver is initialized; if not, it will call initialize() using default arguments. After initialization, the solver performs MINRES iterations until the status test evaluates as Passed, at which point the method returns to the caller.

The status test is queried at the beginning of the iteration.

Implements Belos::Iteration< ScalarType, MV, OP >.

Definition at line 426 of file BelosMinresIter.hpp.

template<class ScalarType , class MV , class OP >
void Belos::MinresIter< ScalarType, MV, OP >::initializeMinres ( const MinresIterationState< ScalarType, MV > &  newstate)
virtual

Initialize the solver to an iterate, providing a complete state.

The MinresIter contains a certain amount of state, consisting of the current residual, preconditioned residual, and decent direction.

initialize() gives the user the opportunity to manually set these, although only the current unpreconditioned residual is required.

Postcondition
isInitialized() == true (see post-conditions of isInitialize())
Note
For any pointer in newstate which directly points to the multivectors in the solver, the data is not copied.

Implements Belos::MinresIteration< ScalarType, MV, OP >.

Definition at line 348 of file BelosMinresIter.hpp.

template<class ScalarType , class MV , class OP >
void Belos::MinresIter< ScalarType, MV, OP >::initialize ( )
inlinevirtual

Initialize the solver.

Initialize the solver. If a starting guess is provided in the linear problem, use that. Otherwise, choose a random starting guess.

Implements Belos::Iteration< ScalarType, MV, OP >.

Definition at line 136 of file BelosMinresIter.hpp.

template<class ScalarType , class MV , class OP >
MinresIterationState<ScalarType,MV> Belos::MinresIter< ScalarType, MV, OP >::getState ( ) const
inlinevirtual

Get the current state of the linear solver.

The returned current state is only valid if isInitialized() == true.

Returns
A MinresIterationState object containing const pointers to the current solver state.

Implements Belos::MinresIteration< ScalarType, MV, OP >.

Definition at line 148 of file BelosMinresIter.hpp.

template<class ScalarType , class MV , class OP >
int Belos::MinresIter< ScalarType, MV, OP >::getNumIters ( ) const
inlinevirtual

Get the current iteration count.

Implements Belos::Iteration< ScalarType, MV, OP >.

Definition at line 169 of file BelosMinresIter.hpp.

template<class ScalarType , class MV , class OP >
void Belos::MinresIter< ScalarType, MV, OP >::resetNumIters ( int  iter = 0)
inlinevirtual

Reset the iteration count.

Implements Belos::Iteration< ScalarType, MV, OP >.

Definition at line 172 of file BelosMinresIter.hpp.

template<class ScalarType , class MV , class OP >
Teuchos::RCP<const MV> Belos::MinresIter< ScalarType, MV, OP >::getNativeResiduals ( std::vector< MagnitudeType > *  norms) const
inline

Get the norms of the residuals native to the solver.

Returns
A std::vector of length blockSize containing the native residuals.

Definition at line 177 of file BelosMinresIter.hpp.

template<class ScalarType , class MV , class OP >
Teuchos::RCP<MV> Belos::MinresIter< ScalarType, MV, OP >::getCurrentUpdate ( ) const
inlinevirtual

Get the current update to the linear system.

Note
This method returns a null pointer because the linear problem is current.

Implements Belos::Iteration< ScalarType, MV, OP >.

Definition at line 192 of file BelosMinresIter.hpp.

template<class ScalarType , class MV , class OP >
void Belos::MinresIter< ScalarType, MV, OP >::symOrtho ( ScalarType  a,
ScalarType  b,
ScalarType *  c,
ScalarType *  s,
ScalarType *  r 
)

Definition at line 582 of file BelosMinresIter.hpp.

template<class ScalarType , class MV , class OP >
const LinearProblem<ScalarType,MV,OP>& Belos::MinresIter< ScalarType, MV, OP >::getProblem ( ) const
inlinevirtual

Get a constant reference to the linear problem.

Implements Belos::Iteration< ScalarType, MV, OP >.

Definition at line 203 of file BelosMinresIter.hpp.

template<class ScalarType , class MV , class OP >
int Belos::MinresIter< ScalarType, MV, OP >::getBlockSize ( ) const
inlinevirtual

Get the blocksize to be used by the iterative solver in solving this linear problem.

Implements Belos::Iteration< ScalarType, MV, OP >.

Definition at line 206 of file BelosMinresIter.hpp.

template<class ScalarType , class MV , class OP >
void Belos::MinresIter< ScalarType, MV, OP >::setBlockSize ( int  blockSize)
inlinevirtual

Set the blocksize to be used by the iterative solver in solving this linear problem.

Implements Belos::Iteration< ScalarType, MV, OP >.

Definition at line 209 of file BelosMinresIter.hpp.

template<class ScalarType , class MV , class OP >
bool Belos::MinresIter< ScalarType, MV, OP >::isInitialized ( ) const
inline

States whether the solver has been initialized or not.

Definition at line 215 of file BelosMinresIter.hpp.

template<class ScalarType , class MV , class OP >
bool Belos::MinresIter< ScalarType, MV, OP >::isInitialized ( )
inlinevirtual

States whether the solver has been initialized or not.

Implements Belos::Iteration< ScalarType, MV, OP >.

Definition at line 216 of file BelosMinresIter.hpp.


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

Generated on Tue Jul 23 2024 09:24:23 for Belos by doxygen 1.8.5