Belos Version of the Day
Belos::MinresSolMgr< ScalarType, MV, OP > Class Template Reference

MINRES linear solver solution manager. More...

#include <BelosMinresSolMgr.hpp>

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

List of all members.

Public Member Functions

Constructors/Destructor
 MinresSolMgr ()
 Default constructor.
 MinresSolMgr (const Teuchos::RCP< LinearProblem< ScalarType, MV, OP > > &problem, const Teuchos::RCP< Teuchos::ParameterList > &params)
 Basic constructor for MinresSolMgr.
virtual ~MinresSolMgr ()
 Destructor.
Accessor methods
const LinearProblem
< ScalarType, MV, OP > & 
getProblem () const
 Return the linear problem to be solved.
Teuchos::RCP< const
Teuchos::ParameterList
getValidParameters () const
 Return the list of default parameters for this object.
Teuchos::RCP< const
Teuchos::ParameterList
getCurrentParameters () const
 Return the list of current parameters for this object.
Teuchos::Array< Teuchos::RCP
< Teuchos::Time > > 
getTimers () const
 Return all timers for this object.
int getNumIters () const
 Get the iteration count for the most recent call to solve().
bool isLOADetected () const
 Whether a loss of accuracy was detected in the solver.
Set methods
void setProblem (const Teuchos::RCP< LinearProblem< ScalarType, MV, OP > > &problem)
 Set the linear problem to be solved.
void setParameters (const Teuchos::RCP< Teuchos::ParameterList > &params)
 Set the parameters to use when solving the linear problem.
Reset methods
void reset (const ResetType type)
 Reset the solver manager.
Solver application methods
ReturnType solve ()
 Iterate until status test tells us to stop.
Overridden from Teuchos::Describable
std::string description () const
 Description of the MINRES solver manager.

MinresSolMgr Exceptions

static Teuchos::RCP< const
Teuchos::ParameterList
defaultParameters ()
 List of default parameters.
static void validateParameters (const Teuchos::RCP< Teuchos::ParameterList > &params)
 Validate parameters.

Detailed Description

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

MINRES linear solver solution manager.

Author:
Nico Schl"omer

The Minimal Residual Method (MINRES) is a Krylov subspace method for solving symmetric (in real arithmetic, or Hermitian in complex arithmetic), nonsingular, but possibly indefinite linear systems

Definition at line 115 of file BelosMinresSolMgr.hpp.


Constructor & Destructor Documentation

template<class ScalarType , class MV , class OP >
Belos::MinresSolMgr< ScalarType, MV, OP >::MinresSolMgr ( )

Default constructor.

This constructor takes no arguments and sets the default values for the solver. The linear problem must be passed in using setProblem() before solve() is called on this object, otherwise an exception is thrown. The solver's parameters (which this constructor sets to their default values) may be changed using setParameters().

Definition at line 458 of file BelosMinresSolMgr.hpp.

template<class ScalarType , class MV , class OP >
Belos::MinresSolMgr< ScalarType, MV, OP >::MinresSolMgr ( const Teuchos::RCP< LinearProblem< ScalarType, MV, OP > > &  problem,
const Teuchos::RCP< Teuchos::ParameterList > &  params 
)

Basic constructor for MinresSolMgr.

Parameters:
problem[in/out] The LinearProblem to be solved
params[in/out] Parameter list of options for the solver manager. Parameters not provided will be filled in with default values. These are the options accepted by the solver manager:
  • "Block Size" - an int specifying the block size to be used by the underlying MINRES solver. Default: 1 (which is the only valid value!)
  • "Convergence Tolerance" - a MagnitudeType specifying the level that residual norms must reach to decide convergence. Default value: 1e-8.
  • "Maximum Iterations" - an int specifying the maximum number of iterations the underlying solver is allowed to perform. Default: 1000
  • "Verbosity" - a sum of MsgType (stored as an int) specifying the verbosity. Default value: Belos::Errors
  • "Output Style" - a OutputType specifying the style of output. Default value: Belos::General
  • "Output Stream" - a reference-counted pointer to the output stream where all solver output is sent. Default value: Teuchos::rcp(&std::cout,false)
  • "Output Frequency" - an int specifying how often (in terms of number of iterations) intermediate convergence information should be written to the output stream. Default value: -1 (which means no intermediate convergence information is ever written to the output stream)
  • "Timer Label" - an std::string to use as a prefix for the timer labels. Default value: "Belos"

Definition at line 472 of file BelosMinresSolMgr.hpp.

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

Destructor.

Definition at line 200 of file BelosMinresSolMgr.hpp.


Member Function Documentation

template<class ScalarType , class MV , class OP >
Teuchos::RCP< const Teuchos::ParameterList > Belos::MinresSolMgr< ScalarType, MV, OP >::defaultParameters ( ) [static]

List of default parameters.

Return a smart pointer to a list of valid parameters and their default values. The right way to set up this solver manager with nondefault parameters, is to make a deep non-const copy of the default parameters, and change the parameters you want to change.

Note:
This is a class ("static") method, so that it can be called before you have constructed a MinresSolMgr object (useful for you, so you can have valid parameters before constructing one), or within the MinresSolMgr constructor (useful for me, so I can set default parameters).

Definition at line 398 of file BelosMinresSolMgr.hpp.

template<class ScalarType , class MV , class OP >
void Belos::MinresSolMgr< ScalarType, MV, OP >::validateParameters ( const Teuchos::RCP< Teuchos::ParameterList > &  params) [static]

Validate parameters.

Validate the given non-null list of parameters. Raise std::invalid_argument if any provided parameters have invalid values. If any parameters that should be there are not provided, fill them in with default values.

Parameters:
params[in/out] Non-null smart pointer to parameter list
Note:
We make this method a public class ("static") method, so you can validate your own list of parameters before creating a MinresSolMgr.

Definition at line 507 of file BelosMinresSolMgr.hpp.

template<class ScalarType , class MV , class OP >
const LinearProblem<ScalarType,MV,OP>& Belos::MinresSolMgr< ScalarType, MV, OP >::getProblem ( ) const [inline, virtual]

Return the linear problem to be solved.

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

Definition at line 207 of file BelosMinresSolMgr.hpp.

template<class ScalarType , class MV , class OP >
Teuchos::RCP< const Teuchos::ParameterList > Belos::MinresSolMgr< ScalarType, MV, OP >::getValidParameters ( ) const [inline, virtual]

Return the list of default parameters for this object.

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

Definition at line 212 of file BelosMinresSolMgr.hpp.

template<class ScalarType , class MV , class OP >
Teuchos::RCP< const Teuchos::ParameterList > Belos::MinresSolMgr< ScalarType, MV, OP >::getCurrentParameters ( ) const [inline, virtual]

Return the list of current parameters for this object.

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

Definition at line 217 of file BelosMinresSolMgr.hpp.

template<class ScalarType , class MV , class OP >
Teuchos::Array< Teuchos::RCP< Teuchos::Time > > Belos::MinresSolMgr< ScalarType, MV, OP >::getTimers ( ) const [inline]

Return all timers for this object.

Return all the timers for this object. Currently only one timer is being used, which is the total time spent in the solve() routine. Thus, the returned Array currently has only one element.

Definition at line 227 of file BelosMinresSolMgr.hpp.

template<class ScalarType , class MV , class OP >
int Belos::MinresSolMgr< ScalarType, MV, OP >::getNumIters ( ) const [inline, virtual]

Get the iteration count for the most recent call to solve().

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

Definition at line 232 of file BelosMinresSolMgr.hpp.

template<class ScalarType , class MV , class OP >
bool Belos::MinresSolMgr< ScalarType, MV, OP >::isLOADetected ( ) const [inline, virtual]

Whether a loss of accuracy was detected in the solver.

Warning:
This implementation of MINRES does not currently attempt to detect a loss of accuracy in the solver; thus we always return false (for now).

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

Definition at line 241 of file BelosMinresSolMgr.hpp.

template<class ScalarType , class MV , class OP >
void Belos::MinresSolMgr< ScalarType, MV, OP >::setProblem ( const Teuchos::RCP< LinearProblem< ScalarType, MV, OP > > &  problem) [inline, virtual]

Set the linear problem to be solved.

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

Definition at line 250 of file BelosMinresSolMgr.hpp.

template<class ScalarType , class MV , class OP >
void Belos::MinresSolMgr< ScalarType, MV, OP >::setParameters ( const Teuchos::RCP< Teuchos::ParameterList > &  params) [virtual]

Set the parameters to use when solving the linear problem.

Parameters:
params[in/out] List of parameters to use when solving the linear problem. This list will be modified as necessary to include default parameters that need not be provided. If params is null, then use default parameters entirely.
Note:
If you want nondefault parameter values, the right way to start is to make a deep copy of the ParameterList returned by defaultParameters(). That ParameterList has all the parameters that MinresSolMgr wants, along with human-readable documentation and validators.

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

Definition at line 663 of file BelosMinresSolMgr.hpp.

template<class ScalarType , class MV , class OP >
void Belos::MinresSolMgr< ScalarType, MV, OP >::reset ( const ResetType  type) [inline, virtual]

Reset the solver manager.

Reset the solver manager in a way specified by the ResetType. This informs the solver manager that the solver should prepare for the next call to solve by resetting certain elements of the iterative solver strategy.

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

Definition at line 283 of file BelosMinresSolMgr.hpp.

template<class ScalarType , class MV , class OP >
ReturnType Belos::MinresSolMgr< ScalarType, MV, OP >::solve ( ) [virtual]

Iterate until status test tells us to stop.

This method performs possibly repeated calls to the underlying linear solver's iterate() routine, until the problem has been solved (as decided by the solver manager via the status test(s)), or the solver manager decides to quit.

This method calls MinresIter::iterate(), which will return either because a specially constructed status test that evaluates to Passed, or an std::exception is thrown.

A return from MinresIter::iterate() signifies one of the following scenarios:

  • the maximum number of iterations has been exceeded. In this scenario, the current solutions to the linear system will be placed in the linear problem and return Unconverged.
  • global convergence has been met. In this case, the current solutions to the linear system will be placed in the linear problem and the solver manager will return Converged
Returns:
ReturnType specifying:
  • Converged: the linear problem was solved to the specification required by the solver manager.
  • Unconverged: the linear problem was not solved to the specification desired by the solver manager.

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

Definition at line 683 of file BelosMinresSolMgr.hpp.

template<class ScalarType , class MV , class OP >
std::string Belos::MinresSolMgr< ScalarType, MV, OP >::description ( ) const [virtual]

Description of the MINRES solver manager.

Reimplemented from Teuchos::Describable.

Definition at line 812 of file BelosMinresSolMgr.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines