10 #ifndef BELOS_SOLVERMANAGER_HPP
11 #define BELOS_SOLVERMANAGER_HPP
24 #include "Teuchos_Describable.hpp"
34 template <
class ScalarType,
class MV,
class OP>
38 template<
class ScalarType,
class MV,
class OP>
121 <<
" overridden for the class" << this->
description() <<
" yet!");
130 <<
" overridden for the class" << this->
description() <<
" yet!");
187 template<
class ScalarType,
194 template<
class ScalarType,
class MV,
class OP>
209 template<
class ScalarType,
class MV,
class OP>
221 "This solver is not implemented for complex ScalarType." );
225 "This solver is not implemented for complex ScalarType." );
229 "This solver is not implemented for complex ScalarType." );
233 "This solver is not implemented for complex ScalarType." );
237 "This solver is not implemented for complex ScalarType." );
241 "This solver is not implemented for complex ScalarType." );
245 "This solver is not implemented for complex ScalarType." );
249 "This solver is not implemented for complex ScalarType." );
253 "This solver is not implemented for complex ScalarType." );
261 template<
class ScalarType>
279 #ifdef HAVE_TEUCHOS_LONG_DOUBLE
283 const static bool value =
true;
288 #ifdef HAVE_TEUCHOS_COMPLEX
290 class LapackSupportsScalar<std::complex<float> > {
292 const static bool value =
true;
296 class LapackSupportsScalar<std::complex<double> > {
298 const static bool value =
true;
300 #endif // HAVE_TEUCHOS_COMPLEX
306 template<
class ScalarType,
309 const bool lapackSupportsScalarType =
317 template<
class ScalarType,
class MV,
class OP>
331 template<
class ScalarType,
class MV,
class OP>
337 (
true, std::logic_error,
"This solver is not implemented for ScalarType"
338 " types for which Teuchos::LAPACK does not have a valid implementation. "
345 (
true, std::logic_error,
"This solver is not implemented for ScalarType"
346 " types for which Teuchos::LAPACK does not have a valid implementation. "
351 (
true, std::logic_error,
"This solver is not implemented for ScalarType"
352 " types for which Teuchos::LAPACK does not have a valid implementation. "
357 (
true, std::logic_error,
"This solver is not implemented for ScalarType"
358 " types for which Teuchos::LAPACK does not have a valid implementation. "
363 (
true, std::logic_error,
"This solver is not implemented for ScalarType"
364 " types for which Teuchos::LAPACK does not have a valid implementation. "
369 (
true, std::logic_error,
"This solver is not implemented for ScalarType"
370 " types for which Teuchos::LAPACK does not have a valid implementation. "
375 (
true, std::logic_error,
"This solver is not implemented for ScalarType"
376 " types for which Teuchos::LAPACK does not have a valid implementation. "
381 (
true, std::logic_error,
"This solver is not implemented for ScalarType"
382 " types for which Teuchos::LAPACK does not have a valid implementation. "
387 (
true, std::logic_error,
"This solver is not implemented for ScalarType"
388 " types for which Teuchos::LAPACK does not have a valid implementation. "
393 (
true, std::logic_error,
"This solver is not implemented for ScalarType"
394 " types for which Teuchos::LAPACK does not have a valid implementation. "
403 template<
class ScalarType,
406 const bool supportsScalarType =
418 template<
class ScalarType,
class MV,
class OP>
433 template<
class ScalarType,
class MV,
class OP>
445 (
true, std::logic_error,
"This solver is not implemented for complex "
446 "ScalarType types, or for ScalarType types for which Teuchos::LAPACK "
447 "does not have a valid implementation."
452 (
true, std::logic_error,
"This solver is not implemented for complex "
453 "ScalarType types, or for ScalarType types for which Teuchos::LAPACK "
454 "does not have a valid implementation."
459 (
true, std::logic_error,
"This solver is not implemented for complex "
460 "ScalarType types, or for ScalarType types for which Teuchos::LAPACK "
461 "does not have a valid implementation."
466 (
true, std::logic_error,
"This solver is not implemented for complex "
467 "ScalarType types, or for ScalarType types for which Teuchos::LAPACK "
468 "does not have a valid implementation."
473 (
true, std::logic_error,
"This solver is not implemented for complex "
474 "ScalarType types, or for ScalarType types for which Teuchos::LAPACK "
475 "does not have a valid implementation."
481 (
true, std::logic_error,
"This solver is not implemented for complex "
482 "ScalarType types, or for ScalarType types for which Teuchos::LAPACK "
483 "does not have a valid implementation."
488 (
true, std::logic_error,
"This solver is not implemented for complex "
489 "ScalarType types, or for ScalarType types for which Teuchos::LAPACK "
490 "does not have a valid implementation."
495 (
true, std::logic_error,
"This solver is not implemented for complex "
496 "ScalarType types, or for ScalarType types for which Teuchos::LAPACK "
497 "does not have a valid implementation."
502 (
true, std::logic_error,
"This solver is not implemented for complex "
503 "ScalarType types, or for ScalarType types for which Teuchos::LAPACK "
504 "does not have a valid implementation."
Collection of types and exceptions used within the Belos solvers.
ComboType
The test can be either the AND of all the component tests, or the OR of all the component tests...
virtual const LinearProblem< ScalarType, MV, OP > & getProblem() const
Return a reference to the linear problem being solved by this solver manager.
virtual void setProblem(const Teuchos::RCP< LinearProblem< ScalarType, MV, OP > > &)
Set the linear problem that needs to be solved.
virtual void setProblem(const Teuchos::RCP< LinearProblem< ScalarType, MV, OP > > &problem)=0
Set the linear problem that needs to be solved.
virtual Teuchos::RCP< const Teuchos::ParameterList > getCurrentParameters() const =0
Return the current parameters being used for this solver manager.
virtual Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
Return the valid parameters for this solver manager.
virtual ~SolverManagerRequiresLapack()
virtual ReturnType solve()
Iterate until the status test tells us to stop.
virtual int getNumIters() const =0
Get the iteration count for the most recent call to solve().
virtual ReturnType solve()
Iterate until the status test tells us to stop.
virtual Teuchos::RCP< const Teuchos::ParameterList > getCurrentParameters() const
Return the current parameters being used for this solver manager.
virtual const LinearProblem< ScalarType, MV, OP > & getProblem() const
Return a reference to the linear problem being solved by this solver manager.
SolverManager()
Empty constructor.
virtual ~RealSolverManager()
virtual ~RealSolverManager()
Base class for Belos::SolverManager subclasses which normally can only compile with real ScalarType t...
virtual int getNumIters() const
Get the iteration count for the most recent call to solve().
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
virtual ReturnType solve()=0
Iterate until the status test tells us to stop.
virtual ~SolverManagerRequiresLapack()
virtual void setParameters(const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
Set the parameters to use when solving the linear problem.
virtual void setProblem(const Teuchos::RCP< LinearProblem< ScalarType, MV, OP > > &problem)
Set the linear problem that needs to be solved.
virtual void setUserConvStatusTest(const Teuchos::RCP< StatusTest< ScalarType, MV, OP > > &, const typename StatusTestCombo< ScalarType, MV, OP >::ComboType &=StatusTestCombo< ScalarType, MV, OP >::SEQ)
Set user-defined convergence status test.
Base class for Belos::SolverManager subclasses which normally can only compile for real ScalarType...
virtual void reset(const ResetType type)=0
Reset the solver manager.
virtual bool isLOADetected() const
Returns whether a loss of accuracy was detected in the solver.
virtual bool isLOADetected() const
Returns whether a loss of accuracy was detected in the solver.
A pure virtual class for defining the status tests for the Belos iterative solvers.
virtual const LinearProblem< ScalarType, MV, OP > & getProblem() const
Return a reference to the linear problem being solved by this solver manager.
virtual Teuchos::RCP< const Teuchos::ParameterList > getCurrentParameters() const
Return the current parameters being used for this solver manager.
virtual ~SolverManagerRequiresRealLapack()
virtual bool isLOADetected() const
Returns whether a loss of accuracy was detected in the solver.
virtual void reset(const ResetType type)
Reset the solver manager.
virtual Teuchos::ScalarTraits< ScalarType >::magnitudeType achievedTol() const
Tolerance achieved by the last solve() invocation.
Belos::StatusTest for logically combining several status tests.
virtual const LinearProblem< ScalarType, MV, OP > & getProblem() const =0
Return a reference to the linear problem being solved by this solver manager.
virtual Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
Return the valid parameters for this solver manager.
virtual void setParameters(const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
Set the parameters to use when solving the linear problem.
ResetType
How to reset the solver.
SolverManagerRequiresLapack()
#define TEUCHOS_TEST_FOR_EXCEPT_MSG(throw_exception_test, msg)
virtual Teuchos::RCP< const Teuchos::ParameterList > getCurrentParameters() const
Return the current parameters being used for this solver manager.
virtual int getNumIters() const
Get the iteration count for the most recent call to solve().
virtual void setProblem(const Teuchos::RCP< LinearProblem< ScalarType, MV, OP > > &problem)
Set the linear problem that needs to be solved.
SolverManagerRequiresRealLapack()
A linear system to solve, and its associated information.
Class which describes the linear problem to be solved by the iterative solver.
virtual Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
Return the valid parameters for this solver manager.
virtual std::string description() const
virtual void setParameters(const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
Set the parameters to use when solving the linear problem.
Type traits class that says whether Teuchos::LAPACK has a valid implementation for the given ScalarTy...
ReturnType
Whether the Belos solve converged for all linear systems.
virtual void setDebugStatusTest(const Teuchos::RCP< StatusTest< ScalarType, MV, OP > > &)
Set user-defined debug status test.
The Belos::SolverManager is a templated virtual base class that defines the basic interface that any ...
virtual void reset(const ResetType type)
Reset the solver manager.
virtual void reset(const ResetType type)
Reset the solver manager.
virtual Teuchos::RCP< SolverManager< ScalarType, MV, OP > > clone() const =0
clone the solver manager.
virtual ~SolverManagerRequiresRealLapack()
virtual void setParameters(const Teuchos::RCP< Teuchos::ParameterList > ¶ms)=0
Set the parameters to use when solving the linear problem.
virtual Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const =0
Return the valid parameters for this solver manager.
SolverManagerRequiresLapack()
virtual int getNumIters() const
Get the iteration count for the most recent call to solve().
virtual bool isLOADetected() const =0
Returns whether a loss of accuracy was detected in the solver.
A class for extending the status testing capabilities of Belos via logical combinations.
SolverManagerRequiresRealLapack()
virtual ReturnType solve()
Iterate until the status test tells us to stop.
Base class for Belos::SolverManager subclasses which normally can only compile with ScalarType types ...
Belos header file which uses auto-configuration information to include necessary C++ headers...
virtual ~SolverManager()
Destructor.