Belos
Version of the Day
|
Implementation of the LSQR iteration. More...
#include <BelosLSQRIter.hpp>
Public Types | |
typedef Belos::MultiVecTraits < ScalarType, MV > | MVT |
typedef Belos::OperatorTraits < ScalarType, MV, OP > | OPT |
typedef Teuchos::ScalarTraits < ScalarType > | SCT |
typedef SCT::magnitudeType | MagnitudeType |
Public Member Functions | |
Constructors/Destructor | |
LSQRIter (const Teuchos::RCP< Belos::LinearProblem< ScalarType, MV, OP > > &problem, const Teuchos::RCP< Belos::OutputManager< ScalarType > > &printer, const Teuchos::RCP< Belos::StatusTest< ScalarType, MV, OP > > &tester, Teuchos::ParameterList ¶ms) | |
LSQRIter constructor with linear problem, solver utilities, and parameter list of solver options. More... | |
virtual | ~LSQRIter () |
Destructor. More... | |
Solver methods | |
void | iterate () |
This method performs LSQR iterations until the status test indicates the need to stop or an error occurs (in which case, an std::exception is thrown). More... | |
void | initializeLSQR (LSQRIterationState< ScalarType, MV > &newstate) |
Initialize the solver to an iterate, completing the initial state. More... | |
void | initialize () |
The solver is initialized using initializeLSQR. More... | |
LSQRIterationState< 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 > *) 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... | |
Accessor methods | |
const Belos::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 to solve this linear problem. More... | |
bool | isInitialized () |
States whether the solver has been initialized or not. More... | |
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... | |
Implementation of the LSQR iteration.
Definition at line 77 of file BelosLSQRIter.hpp.
typedef Belos::MultiVecTraits<ScalarType,MV> Belos::LSQRIter< ScalarType, MV, OP >::MVT |
Definition at line 84 of file BelosLSQRIter.hpp.
typedef Belos::OperatorTraits<ScalarType,MV,OP> Belos::LSQRIter< ScalarType, MV, OP >::OPT |
Definition at line 85 of file BelosLSQRIter.hpp.
typedef Teuchos::ScalarTraits<ScalarType> Belos::LSQRIter< ScalarType, MV, OP >::SCT |
Definition at line 86 of file BelosLSQRIter.hpp.
typedef SCT::magnitudeType Belos::LSQRIter< ScalarType, MV, OP >::MagnitudeType |
Definition at line 87 of file BelosLSQRIter.hpp.
Belos::LSQRIter< ScalarType, MV, OP >::LSQRIter | ( | const Teuchos::RCP< Belos::LinearProblem< ScalarType, MV, OP > > & | problem, |
const Teuchos::RCP< Belos::OutputManager< ScalarType > > & | printer, | ||
const Teuchos::RCP< Belos::StatusTest< ScalarType, MV, OP > > & | tester, | ||
Teuchos::ParameterList & | params | ||
) |
LSQRIter constructor with linear problem, solver utilities, and parameter list of solver options.
This constructor takes pointers required by the linear solver iteration, in addition to a parameter list of options for the linear solver.
Definition at line 289 of file BelosLSQRIter.hpp.
|
inlinevirtual |
Destructor.
Definition at line 108 of file BelosLSQRIter.hpp.
|
virtual |
This method performs LSQR iterations until the status test indicates the need to stop or an error occurs (in which case, an std::exception is thrown).
iterate() first determine whether the solver is initialized; if not, it will call initialize() without arguments. After initialization, iterate() iterates LSQR until the status test is Passed, and then returns to the caller.
The status test is queried at the beginning of the iteration.
Implements Belos::Iteration< ScalarType, MV, OP >.
Definition at line 435 of file BelosLSQRIter.hpp.
void Belos::LSQRIter< ScalarType, MV, OP >::initializeLSQR | ( | LSQRIterationState< ScalarType, MV > & | newstate | ) |
Initialize the solver to an iterate, completing the initial state.
The LSQRIter contains a certain amount of state, consisting of two bidiagonalization vectors, a descent direction, a damping value, and various estimates of errors and the like.
newstate
which directly points to the multivectors in the solver, the data is not copied. Definition at line 346 of file BelosLSQRIter.hpp.
|
inlinevirtual |
The solver is initialized using initializeLSQR.
Implements Belos::Iteration< ScalarType, MV, OP >.
Definition at line 141 of file BelosLSQRIter.hpp.
|
inline |
Get the current state of the linear solver.
The data is only valid if isInitialized() == true
.
Definition at line 154 of file BelosLSQRIter.hpp.
|
inlinevirtual |
Get the current iteration count.
Implements Belos::Iteration< ScalarType, MV, OP >.
Definition at line 176 of file BelosLSQRIter.hpp.
|
inlinevirtual |
Reset the iteration count.
Implements Belos::Iteration< ScalarType, MV, OP >.
Definition at line 179 of file BelosLSQRIter.hpp.
|
inline |
Get the norms of the residuals native to the solver.
Definition at line 183 of file BelosLSQRIter.hpp.
|
inlinevirtual |
Get the current update to the linear system.
Implements Belos::Iteration< ScalarType, MV, OP >.
Definition at line 188 of file BelosLSQRIter.hpp.
|
inlinevirtual |
Get a constant reference to the linear problem.
Implements Belos::Iteration< ScalarType, MV, OP >.
Definition at line 196 of file BelosLSQRIter.hpp.
|
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 199 of file BelosLSQRIter.hpp.
|
inlinevirtual |
Set the blocksize to be used by the iterative solver to solve this linear problem.
Implements Belos::Iteration< ScalarType, MV, OP >.
Definition at line 204 of file BelosLSQRIter.hpp.
|
inlinevirtual |
States whether the solver has been initialized or not.
Implements Belos::Iteration< ScalarType, MV, OP >.
Definition at line 210 of file BelosLSQRIter.hpp.