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;
59 (MVT::GetGlobalLength(*
tmp) == MVT::GetGlobalLength(*
R)));
141template<
class ScalarType,
class MV,
class OP>
170 virtual Teuchos::RCP<CGIterationStateBase<ScalarType,MV> >
getState()
const = 0;
180 virtual Teuchos::ArrayView<typename Teuchos::ScalarTraits<ScalarType>::magnitudeType>
getDiag() = 0;
183 virtual Teuchos::ArrayView<typename Teuchos::ScalarTraits<ScalarType>::magnitudeType>
getOffDiag() = 0;
Belos header file which uses auto-configuration information to include necessary C++ headers.
Pure virtual base class which describes the basic interface to the linear solver iteration.
Declaration of basic traits for the multivector type.
Collection of types and exceptions used within the Belos solvers.
Parent class to all Belos exceptions.
CGIterateFailure is thrown when the CGIteration object is unable to compute the next iterate in the C...
CGIterateFailure(const std::string &what_arg)
CGIterationInitFailure is thrown when the CGIteration object is unable to generate an initial iterate...
CGIterationInitFailure(const std::string &what_arg)
CGIterationLAPACKFailure is thrown when a nonzero return value is passed back from an LAPACK routine.
CGIterationLAPACKFailure(const std::string &what_arg)
CGIterationOrthoFailure is thrown when the CGIteration object is unable to compute independent direct...
CGIterationOrthoFailure(const std::string &what_arg)
Structure to contain pointers to CGIteration state variables.
Teuchos::RCP< MV > R
The current residual.
Teuchos::RCP< MV > P
The current decent direction vector.
virtual void initialize(Teuchos::RCP< const MV > tmp, int _numVectors)
bool isInitialized() const
virtual bool matches(Teuchos::RCP< const MV > tmp, int _numVectors=1) const
Teuchos::RCP< MV > Z
The current preconditioned residual.
Teuchos::RCP< MV > AP
The matrix A applied to current decent direction vector.
virtual ~CGIterationStateBase()=default
virtual Teuchos::RCP< CGIterationStateBase< ScalarType, MV > > getState() const =0
Get the current state of the linear solver.
virtual Teuchos::ArrayView< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > getOffDiag()=0
Gets the off-diagonal for condition estimation.
virtual void setDoCondEst(bool val)=0
Sets whether or not to store the diagonal for condition estimation.
virtual Teuchos::ArrayView< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > getDiag()=0
Gets the diagonal for condition estimation.
virtual void setState(Teuchos::RCP< CGIterationStateBase< ScalarType, MV > > state)=0
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.
CGPositiveDefiniteFailure is thrown when the the CG 'alpha = p^H*A*P' value is less than zero,...
CGPositiveDefiniteFailure(const std::string &what_arg)
Alternative run-time polymorphic interface for operators.