10#ifndef __Belos_InnerSolver_hpp
11#define __Belos_InnerSolver_hpp
17#include <Teuchos_ScalarTraits.hpp>
32 template<
class Scalar,
class MV,
class OP>
33 Teuchos::RCP<LinearProblem<Scalar, MV, OP> >
35 const Teuchos::RCP<const MV>& B)
37 using Teuchos::is_null;
38 using Teuchos::nonnull;
48 "problemWithNewRHS(): The original LinearProblem's "
49 "initial guess / current approximate solution (getLHS())"
50 " is null. We need an initial guess or current approxim"
51 "ate solution in order to know the domain of the (right-"
52 "preconditioned, if applicable) operator. This is "
53 "because Belos::MultiVecTraits does not include the idea"
54 " of the domain and range of an operator, or the space "
55 "to which a vector belongs.");
57 "problemWithNewRHS(): the given new right-hand side B "
62 lp->setLeftPrec (
problem->getLeftPrec ());
63 lp->setRightPrec (
problem->getRightPrec ());
105 template<
class Scalar,
class MV,
class OP>
122 virtual Teuchos::RCP<const Teuchos::ParameterList>
170 const Teuchos::RCP<const MV>& B,
220 const Teuchos::RCP<const MV>& B) = 0;
232 template<
class Scalar,
class MV,
class OP>
242 using Teuchos::rcpFromRef;
245 "Belos::InnerSolver is not able to solve the "
246 "transposed system.");
261 template<
class Scalar,
class MV,
class OP>
265 (
void) Scalar::this_specialization_is_not_defined();
266 (
void) MV::this_specialization_is_not_defined();
267 (
void) OP::this_specialization_is_not_defined();
290 template<
class Scalar,
class MV,
class OP>
303 static Teuchos::RCP<OP>
307 using Teuchos::rcp_implicit_cast;
324 static Teuchos::RCP<inner_solver_type>
328 using Teuchos::rcp_dynamic_cast;
333 return wrapper->getInnerSolver();
Class which describes the linear problem to be solved by the iterative solver.
Declaration of basic traits for the multivector type.
Class which defines basic traits for the operator type.
Represents the result of an inner solve.
Wrap an InnerSolver in an OP (operator).
InnerSolver< scalar_type, multivector_type, operator_type > inner_solver_type
static Teuchos::RCP< inner_solver_type > getInnerSolver(const Teuchos::RCP< operator_type > &op)
Return the given wrapper's inner solver object.
UndefinedWrapperType< Scalar, MV, OP > wrapper_type
static Teuchos::RCP< OP > makeInnerSolverOperator(const Teuchos::RCP< InnerSolver< Scalar, MV, OP > > &solver)
Wrap the given inner solver in a wrapper_type.
virtual ~InnerSolver()
Virtual destructor, for correctness.
virtual Teuchos::RCP< const Teuchos::ParameterList > getCurrentParameters() const =0
Current parameters for the inner solver implementation.
Teuchos::ScalarTraits< Scalar >::magnitudeType magnitude_type
virtual InnerSolveResult solve(const Teuchos::RCP< MV > &X, const Teuchos::RCP< const MV > &B)=0
Solve for the given right-hand side(s) B.
virtual InnerSolveResult solve(const Teuchos::RCP< MV > &X, const Teuchos::RCP< const MV > &B, const magnitude_type convTol, const int maxItersPerRestart, const int maxNumRestarts)=0
Solve for the given right-hand side(s) B.
static void Apply(const InnerSolver< Scalar, MV, OP > &Op, const MV &x, MV &y, ETrans trans=NOTRANS)
Class which defines basic traits for the operator type.
Alternative run-time polymorphic interface for operators.
Undefined wrapper type, to check at compile time whether InnerSolverTraits has been specialized.
ETrans
Whether to apply the (conjugate) transpose of an operator.
Teuchos::RCP< LinearProblem< Scalar, MV, OP > > problemWithNewRHS(const Teuchos::RCP< const LinearProblem< Scalar, MV, OP > > &problem, const Teuchos::RCP< const MV > &B)
New LinearProblem with different right-hand side.