10 #ifndef BELOS_CG_ITERATION_HPP
11 #define BELOS_CG_ITERATION_HPP
21 #include "Teuchos_Assert.hpp"
32 template <
class ScalarType,
class MV>
41 isInitialized_ =
true;
42 numVectors_ = _numVectors;
59 (MVT::GetGlobalLength(*tmp) == MVT::GetGlobalLength(*
R)));
141 template<
class ScalarType,
class MV,
class OP>
Collection of types and exceptions used within the Belos solvers.
CGIterateFailure(const std::string &what_arg)
CGIterationOrthoFailure(const std::string &what_arg)
virtual void initializeCG(Teuchos::RCP< CGIterationStateBase< ScalarType, MV > > newstate, Teuchos::RCP< MV > R_0)=0
Initialize the solver to an iterate, providing a complete state.
Declaration of basic traits for the multivector type.
virtual void setDoCondEst(bool val)=0
Sets whether or not to store the diagonal for condition estimation.
virtual Teuchos::RCP< CGIterationStateBase< ScalarType, MV > > getState() const =0
Get the current state of the linear solver.
Pure virtual base class which describes the basic interface to the linear solver iteration.
virtual ~CGIterationStateBase()=default
CGIterateFailure is thrown when the CGIteration object is unable to compute the next iterate in the C...
virtual Teuchos::ArrayView< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > getDiag()=0
Gets the diagonal for condition estimation.
Teuchos::RCP< MV > P
The current decent direction vector.
bool isInitialized() const
Traits class which defines basic operations on multivectors.
CGPositiveDefiniteFailure is thrown when the the CG 'alpha = p^H*A*P' value is less than zero...
CGIterationLAPACKFailure is thrown when a nonzero return value is passed back from an LAPACK routine...
virtual void initialize(Teuchos::RCP< const MV > tmp, int _numVectors)
virtual Teuchos::ArrayView< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > getOffDiag()=0
Gets the off-diagonal for condition estimation.
Structure to contain pointers to CGIteration state variables.
Teuchos::RCP< MV > Z
The current preconditioned residual.
Teuchos::RCP< MV > AP
The matrix A applied to current decent direction vector.
CGIterationOrthoFailure is thrown when the CGIteration object is unable to compute independent direct...
CGIterationLAPACKFailure(const std::string &what_arg)
virtual void setState(Teuchos::RCP< CGIterationStateBase< ScalarType, MV > > state)=0
CGPositiveDefiniteFailure(const std::string &what_arg)
CGIterationInitFailure is thrown when the CGIteration object is unable to generate an initial iterate...
Parent class to all Belos exceptions.
#define TEUCHOS_ASSERT(assertion_test)
Teuchos::RCP< MV > R
The current residual.
Belos header file which uses auto-configuration information to include necessary C++ headers...
CGIterationInitFailure(const std::string &what_arg)
virtual bool matches(Teuchos::RCP< const MV > tmp, int _numVectors=1) const