42 #ifndef BELOS_PSEUDO_BLOCK_CG_SOLMGR_HPP 43 #define BELOS_PSEUDO_BLOCK_CG_SOLMGR_HPP 63 #include "Teuchos_LAPACK.hpp" 64 #ifdef BELOS_TEUCHOS_TIME_MONITOR 65 #include "Teuchos_TimeMonitor.hpp" 112 template<
class ScalarType,
class MV,
class OP,
113 const bool supportsScalarType =
117 Belos::Details::LapackSupportsScalar<ScalarType>::value>
119 static const bool scalarTypeIsSupported =
129 const Teuchos::RCP<Teuchos::ParameterList> &pl) :
134 Teuchos::RCP<StatusTestGenResNorm<ScalarType,MV,OP> >
139 template<
class ScalarType,
class MV,
class OP>
146 typedef Teuchos::ScalarTraits<ScalarType> SCT;
147 typedef typename Teuchos::ScalarTraits<ScalarType>::magnitudeType MagnitudeType;
148 typedef Teuchos::ScalarTraits<MagnitudeType> MT;
178 const Teuchos::RCP<Teuchos::ParameterList> &pl );
184 Teuchos::RCP<SolverManager<ScalarType, MV, OP> >
clone ()
const override {
198 Teuchos::RCP<const Teuchos::ParameterList> getValidParameters()
const override;
209 Teuchos::Array<Teuchos::RCP<Teuchos::Time> >
getTimers()
const {
210 return Teuchos::tuple(timerSolve_);
244 Teuchos::RCP<StatusTestGenResNorm<ScalarType,MV,OP> >
256 void setParameters(
const Teuchos::RCP<Teuchos::ParameterList> ¶ms )
override;
297 std::string description()
const override;
302 void compute_condnum_tridiag_sym(Teuchos::ArrayView<MagnitudeType> diag,
303 Teuchos::ArrayView<MagnitudeType> offdiag,
304 ScalarType & lambda_min,
305 ScalarType & lambda_max,
306 ScalarType & ConditionNumber );
309 Teuchos::RCP<LinearProblem<ScalarType,MV,OP> > problem_;
312 Teuchos::RCP<OutputManager<ScalarType> > printer_;
313 Teuchos::RCP<std::ostream> outputStream_;
316 Teuchos::RCP<StatusTest<ScalarType,MV,OP> > sTest_;
317 Teuchos::RCP<StatusTestMaxIters<ScalarType,MV,OP> > maxIterTest_;
318 Teuchos::RCP<StatusTestGenResNorm<ScalarType,MV,OP> > convTest_;
319 Teuchos::RCP<StatusTestOutput<ScalarType,MV,OP> > outputTest_;
322 Teuchos::RCP<Teuchos::ParameterList> params_;
329 mutable Teuchos::RCP<const Teuchos::ParameterList> validParams_;
332 static constexpr
int maxIters_default_ = 1000;
333 static constexpr
bool assertPositiveDefiniteness_default_ =
true;
334 static constexpr
bool showMaxResNormOnly_default_ =
false;
337 static constexpr
int outputFreq_default_ = -1;
338 static constexpr
int defQuorum_default_ = 1;
339 static constexpr
bool foldConvergenceDetectionIntoAllreduce_default_ =
false;
340 static constexpr
const char * resScale_default_ =
"Norm of Initial Residual";
341 static constexpr
const char * label_default_ =
"Belos";
343 #if defined(_WIN32) && defined(__clang__) 344 static constexpr std::ostream * outputStream_default_ =
345 __builtin_constant_p(reinterpret_cast<const std::ostream*>(&std::cout));
347 static constexpr std::ostream * outputStream_default_ = &std::cout;
349 static constexpr
bool genCondEst_default_ =
false;
352 MagnitudeType convtol_,achievedTol_;
353 int maxIters_, numIters_;
354 int verbosity_, outputStyle_, outputFreq_, defQuorum_;
355 bool assertPositiveDefiniteness_, showMaxResNormOnly_;
356 bool foldConvergenceDetectionIntoAllreduce_;
357 std::string resScale_;
359 ScalarType condEstimate_;
363 Teuchos::RCP<Teuchos::Time> timerSolve_;
371 template<
class ScalarType,
class MV,
class OP>
373 outputStream_(Teuchos::rcp(outputStream_default_,false)),
375 maxIters_(maxIters_default_),
377 verbosity_(verbosity_default_),
378 outputStyle_(outputStyle_default_),
379 outputFreq_(outputFreq_default_),
380 defQuorum_(defQuorum_default_),
381 assertPositiveDefiniteness_(assertPositiveDefiniteness_default_),
382 showMaxResNormOnly_(showMaxResNormOnly_default_),
383 foldConvergenceDetectionIntoAllreduce_(foldConvergenceDetectionIntoAllreduce_default_),
384 resScale_(resScale_default_),
385 genCondEst_(genCondEst_default_),
386 condEstimate_(-Teuchos::ScalarTraits<ScalarType>::one()),
387 label_(label_default_),
392 template<
class ScalarType,
class MV,
class OP>
395 const Teuchos::RCP<Teuchos::ParameterList> &pl ) :
397 outputStream_(Teuchos::rcp(outputStream_default_,false)),
399 maxIters_(maxIters_default_),
401 verbosity_(verbosity_default_),
402 outputStyle_(outputStyle_default_),
403 outputFreq_(outputFreq_default_),
404 defQuorum_(defQuorum_default_),
405 assertPositiveDefiniteness_(assertPositiveDefiniteness_default_),
406 showMaxResNormOnly_(showMaxResNormOnly_default_),
407 foldConvergenceDetectionIntoAllreduce_(foldConvergenceDetectionIntoAllreduce_default_),
408 resScale_(resScale_default_),
409 genCondEst_(genCondEst_default_),
410 condEstimate_(-Teuchos::ScalarTraits<ScalarType>::one()),
411 label_(label_default_),
414 TEUCHOS_TEST_FOR_EXCEPTION(
415 problem_.is_null (), std::invalid_argument,
416 "Belos::PseudoBlockCGSolMgr two-argument constructor: " 417 "'problem' is null. You must supply a non-null Belos::LinearProblem " 418 "instance when calling this constructor.");
420 if (! pl.is_null ()) {
426 template<
class ScalarType,
class MV,
class OP>
431 using Teuchos::ParameterList;
432 using Teuchos::parameterList;
436 RCP<const ParameterList> defaultParams = this->getValidParameters ();
455 if (params_.is_null ()) {
457 params_ = parameterList (defaultParams->name ());
459 params->validateParameters (*defaultParams);
463 if (params->isParameter (
"Maximum Iterations")) {
464 maxIters_ = params->get (
"Maximum Iterations", maxIters_default_);
467 params_->set (
"Maximum Iterations", maxIters_);
468 if (! maxIterTest_.is_null ()) {
469 maxIterTest_->setMaxIters (maxIters_);
474 if (params->isParameter (
"Assert Positive Definiteness")) {
475 assertPositiveDefiniteness_ =
476 params->get (
"Assert Positive Definiteness",
477 assertPositiveDefiniteness_default_);
480 params_->set (
"Assert Positive Definiteness", assertPositiveDefiniteness_);
483 if (params->isParameter(
"Fold Convergence Detection Into Allreduce")) {
484 foldConvergenceDetectionIntoAllreduce_ = params->get(
"Fold Convergence Detection Into Allreduce",
485 foldConvergenceDetectionIntoAllreduce_default_);
489 if (params->isParameter (
"Timer Label")) {
490 const std::string tempLabel = params->get (
"Timer Label", label_default_);
493 if (tempLabel != label_) {
495 params_->set (
"Timer Label", label_);
496 const std::string solveLabel =
497 label_ +
": PseudoBlockCGSolMgr total solve time";
498 #ifdef BELOS_TEUCHOS_TIME_MONITOR 499 timerSolve_ = Teuchos::TimeMonitor::getNewCounter (solveLabel);
505 if (params->isParameter (
"Verbosity")) {
506 if (Teuchos::isParameterType<int> (*params,
"Verbosity")) {
507 verbosity_ = params->get (
"Verbosity", verbosity_default_);
509 verbosity_ = (int) Teuchos::getParameter<Belos::MsgType> (*params,
"Verbosity");
513 params_->set (
"Verbosity", verbosity_);
514 if (! printer_.is_null ()) {
515 printer_->setVerbosity (verbosity_);
520 if (params->isParameter (
"Output Style")) {
521 if (Teuchos::isParameterType<int> (*params,
"Output Style")) {
522 outputStyle_ = params->get (
"Output Style", outputStyle_default_);
525 outputStyle_ = (int) Teuchos::getParameter<Belos::OutputType> (*params,
"Output Style");
530 params_->set (
"Output Style", outputStyle_);
531 outputTest_ = Teuchos::null;
535 if (params->isParameter (
"Output Stream")) {
536 outputStream_ = params->get<RCP<std::ostream> > (
"Output Stream");
539 params_->set (
"Output Stream", outputStream_);
540 if (! printer_.is_null ()) {
541 printer_->setOStream (outputStream_);
547 if (params->isParameter (
"Output Frequency")) {
548 outputFreq_ = params->get (
"Output Frequency", outputFreq_default_);
552 params_->set (
"Output Frequency", outputFreq_);
553 if (! outputTest_.is_null ()) {
554 outputTest_->setOutputFrequency (outputFreq_);
559 if (params->isParameter (
"Estimate Condition Number")) {
560 genCondEst_ = params->get (
"Estimate Condition Number", genCondEst_default_);
564 if (printer_.is_null ()) {
573 if (params->isParameter (
"Convergence Tolerance")) {
574 if (params->isType<MagnitudeType> (
"Convergence Tolerance")) {
575 convtol_ = params->get (
"Convergence Tolerance",
583 params_->set (
"Convergence Tolerance", convtol_);
584 if (! convTest_.is_null ()) {
589 if (params->isParameter (
"Show Maximum Residual Norm Only")) {
590 showMaxResNormOnly_ = params->get<
bool> (
"Show Maximum Residual Norm Only");
593 params_->set (
"Show Maximum Residual Norm Only", showMaxResNormOnly_);
594 if (! convTest_.is_null ()) {
595 convTest_->setShowMaxResNormOnly (showMaxResNormOnly_);
600 bool newResTest =
false;
605 std::string tempResScale = resScale_;
606 bool implicitResidualScalingName =
false;
607 if (params->isParameter (
"Residual Scaling")) {
608 tempResScale = params->get<std::string> (
"Residual Scaling");
610 else if (params->isParameter (
"Implicit Residual Scaling")) {
611 tempResScale = params->get<std::string> (
"Implicit Residual Scaling");
612 implicitResidualScalingName =
true;
616 if (resScale_ != tempResScale) {
619 resScale_ = tempResScale;
623 if (implicitResidualScalingName) {
624 params_->set (
"Implicit Residual Scaling", resScale_);
627 params_->set (
"Residual Scaling", resScale_);
630 if (! convTest_.is_null ()) {
634 catch (std::exception& e) {
643 if (params->isParameter (
"Deflation Quorum")) {
644 defQuorum_ = params->get (
"Deflation Quorum", defQuorum_);
645 params_->set (
"Deflation Quorum", defQuorum_);
646 if (! convTest_.is_null ()) {
647 convTest_->setQuorum( defQuorum_ );
654 if (maxIterTest_.is_null ()) {
659 if (convTest_.is_null () || newResTest) {
660 convTest_ = rcp (
new StatusTestResNorm_t (convtol_, defQuorum_, showMaxResNormOnly_));
664 if (sTest_.is_null () || newResTest) {
665 sTest_ = rcp (
new StatusTestCombo_t (StatusTestCombo_t::OR, maxIterTest_, convTest_));
668 if (outputTest_.is_null () || newResTest) {
672 outputTest_ = stoFactory.
create (printer_, sTest_, outputFreq_,
676 const std::string solverDesc =
" Pseudo Block CG ";
677 outputTest_->setSolverDesc (solverDesc);
681 if (timerSolve_.is_null ()) {
682 const std::string solveLabel =
683 label_ +
": PseudoBlockCGSolMgr total solve time";
684 #ifdef BELOS_TEUCHOS_TIME_MONITOR 685 timerSolve_ = Teuchos::TimeMonitor::getNewCounter (solveLabel);
694 template<
class ScalarType,
class MV,
class OP>
695 Teuchos::RCP<const Teuchos::ParameterList>
698 using Teuchos::ParameterList;
699 using Teuchos::parameterList;
702 if (validParams_.is_null()) {
704 RCP<ParameterList> pl = parameterList ();
706 "The relative residual tolerance that needs to be achieved by the\n" 707 "iterative solver in order for the linear system to be declared converged.");
708 pl->set(
"Maximum Iterations", static_cast<int>(maxIters_default_),
709 "The maximum number of block iterations allowed for each\n" 710 "set of RHS solved.");
711 pl->set(
"Assert Positive Definiteness", static_cast<bool>(assertPositiveDefiniteness_default_),
712 "Whether or not to assert that the linear operator\n" 713 "and the preconditioner are indeed positive definite.");
714 pl->set(
"Verbosity", static_cast<int>(verbosity_default_),
715 "What type(s) of solver information should be outputted\n" 716 "to the output stream.");
717 pl->set(
"Output Style", static_cast<int>(outputStyle_default_),
718 "What style is used for the solver information outputted\n" 719 "to the output stream.");
720 pl->set(
"Output Frequency", static_cast<int>(outputFreq_default_),
721 "How often convergence information should be outputted\n" 722 "to the output stream.");
723 pl->set(
"Deflation Quorum", static_cast<int>(defQuorum_default_),
724 "The number of linear systems that need to converge before\n" 725 "they are deflated. This number should be <= block size.");
726 pl->set(
"Output Stream", Teuchos::rcp(outputStream_default_,
false),
727 "A reference-counted pointer to the output stream where all\n" 728 "solver output is sent.");
729 pl->set(
"Show Maximum Residual Norm Only", static_cast<bool>(showMaxResNormOnly_default_),
730 "When convergence information is printed, only show the maximum\n" 731 "relative residual norm when the block size is greater than one.");
732 pl->set(
"Implicit Residual Scaling", resScale_default_,
733 "The type of scaling used in the residual convergence test.");
734 pl->set(
"Estimate Condition Number", static_cast<bool>(genCondEst_default_),
735 "Whether or not to estimate the condition number of the preconditioned system.");
741 pl->set(
"Residual Scaling", resScale_default_,
742 "The type of scaling used in the residual convergence test. This " 743 "name is deprecated; the new name is \"Implicit Residual Scaling\".");
744 pl->set(
"Timer Label", static_cast<const char *>(label_default_),
745 "The string to use as a prefix for the timer labels.");
746 pl->set(
"Fold Convergence Detection Into Allreduce",static_cast<bool>(foldConvergenceDetectionIntoAllreduce_default_),
747 "Merge the allreduce for convergence detection with the one for CG.\n" 748 "This saves one all-reduce, but incurs more computation.");
756 template<
class ScalarType,
class MV,
class OP>
759 const char prefix[] =
"Belos::PseudoBlockCGSolMgr::solve: ";
764 if (!isSet_) { setParameters( params_ ); }
766 TEUCHOS_TEST_FOR_EXCEPTION
768 prefix <<
"The linear problem to solve is not ready. You must call " 769 "setProblem() on the Belos::LinearProblem instance before telling the " 770 "Belos solver to solve it.");
774 int numRHS2Solve = MVT::GetNumberVecs( *(problem_->getRHS()) );
775 int numCurrRHS = numRHS2Solve;
777 std::vector<int> currIdx( numRHS2Solve ), currIdx2( numRHS2Solve );
778 for (
int i=0; i<numRHS2Solve; ++i) {
779 currIdx[i] = startPtr+i;
784 problem_->setLSIndex( currIdx );
788 Teuchos::ParameterList plist;
790 plist.set(
"Assert Positive Definiteness",assertPositiveDefiniteness_);
791 if(genCondEst_) plist.set(
"Max Size For Condest",maxIters_);
794 outputTest_->reset();
797 bool isConverged =
true;
801 Teuchos::RCP<CGIteration<ScalarType,MV,OP> > block_cg_iter;
802 if (numRHS2Solve == 1) {
803 plist.set(
"Fold Convergence Detection Into Allreduce",
804 foldConvergenceDetectionIntoAllreduce_);
813 block_cg_iter->setDoCondEst(genCondEst_);
814 bool condEstPerf =
false;
818 #ifdef BELOS_TEUCHOS_TIME_MONITOR 819 Teuchos::TimeMonitor slvtimer(*timerSolve_);
822 while ( numRHS2Solve > 0 ) {
825 std::vector<int> convRHSIdx;
826 std::vector<int> currRHSIdx( currIdx );
827 currRHSIdx.resize(numCurrRHS);
830 block_cg_iter->resetNumIters();
833 outputTest_->resetNumCalls();
836 Teuchos::RCP<MV> R_0 = MVT::CloneViewNonConst( *(Teuchos::rcp_const_cast<MV>(problem_->getInitResVec())), currIdx );
841 block_cg_iter->initializeCG(newState);
848 block_cg_iter->iterate();
855 if ( convTest_->getStatus() ==
Passed ) {
862 if (convIdx.size() == currRHSIdx.size())
866 problem_->setCurrLS();
870 for (
unsigned int i=0; i<currRHSIdx.size(); ++i) {
872 for (
unsigned int j=0; j<convIdx.size(); ++j) {
873 if (currRHSIdx[i] == convIdx[j]) {
879 currIdx2[have] = currIdx2[i];
880 currRHSIdx[have++] = currRHSIdx[i];
883 currRHSIdx.resize(have);
884 currIdx2.resize(have);
887 if (currRHSIdx[0] != 0 && genCondEst_ && !condEstPerf)
890 ScalarType l_min, l_max;
891 Teuchos::ArrayView<MagnitudeType> diag = block_cg_iter->getDiag();
892 Teuchos::ArrayView<MagnitudeType> offdiag = block_cg_iter->getOffDiag();
893 compute_condnum_tridiag_sym(diag,offdiag,l_min,l_max,condEstimate_);
896 block_cg_iter->setDoCondEst(
false);
901 problem_->setLSIndex( currRHSIdx );
904 std::vector<MagnitudeType> norms;
905 R_0 = MVT::CloneCopy( *(block_cg_iter->getNativeResiduals(&norms)),currIdx2 );
906 for (
int i=0; i<have; ++i) { currIdx2[i] = i; }
911 block_cg_iter->initializeCG(defstate);
919 else if ( maxIterTest_->getStatus() ==
Passed ) {
933 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::logic_error,
934 "Belos::PseudoBlockCGSolMgr::solve(): Invalid return from PseudoBlockCGIter::iterate().");
937 catch (
const std::exception &e) {
938 printer_->stream(
Errors) <<
"Error! Caught std::exception in PseudoBlockCGIter::iterate() at iteration " 939 << block_cg_iter->getNumIters() << std::endl
940 << e.what() << std::endl;
946 problem_->setCurrLS();
949 startPtr += numCurrRHS;
950 numRHS2Solve -= numCurrRHS;
952 if ( numRHS2Solve > 0 ) {
954 numCurrRHS = numRHS2Solve;
955 currIdx.resize( numCurrRHS );
956 currIdx2.resize( numCurrRHS );
957 for (
int i=0; i<numCurrRHS; ++i)
958 { currIdx[i] = startPtr+i; currIdx2[i] = i; }
961 problem_->setLSIndex( currIdx );
964 currIdx.resize( numRHS2Solve );
975 #ifdef BELOS_TEUCHOS_TIME_MONITOR 980 Teuchos::TimeMonitor::summarize( printer_->stream(
TimingDetails) );
984 numIters_ = maxIterTest_->getNumIters();
988 const std::vector<MagnitudeType>* pTestValues = convTest_->getTestValue();
989 if (pTestValues != NULL && pTestValues->size () > 0) {
990 achievedTol_ = *std::max_element (pTestValues->begin(), pTestValues->end());
994 if (genCondEst_ && !condEstPerf) {
995 ScalarType l_min, l_max;
996 Teuchos::ArrayView<MagnitudeType> diag = block_cg_iter->getDiag();
997 Teuchos::ArrayView<MagnitudeType> offdiag = block_cg_iter->getOffDiag();
998 compute_condnum_tridiag_sym(diag,offdiag,l_min,l_max,condEstimate_);
1002 if (! isConverged) {
1009 template<
class ScalarType,
class MV,
class OP>
1012 std::ostringstream oss;
1013 oss <<
"Belos::PseudoBlockCGSolMgr<...,"<<Teuchos::ScalarTraits<ScalarType>::name()<<
">";
1020 template<
class ScalarType,
class MV,
class OP>
1024 Teuchos::ArrayView<MagnitudeType> offdiag,
1025 ScalarType & lambda_min,
1026 ScalarType & lambda_max,
1027 ScalarType & ConditionNumber )
1029 typedef Teuchos::ScalarTraits<ScalarType> STS;
1038 const int N = diag.size ();
1039 ScalarType scalar_dummy;
1040 std::vector<MagnitudeType> mag_dummy(4*N);
1042 Teuchos::LAPACK<int,ScalarType> lapack;
1044 lambda_min = STS::one ();
1045 lambda_max = STS::one ();
1047 lapack.PTEQR (char_N, N, diag.getRawPtr (), offdiag.getRawPtr (),
1048 &scalar_dummy, 1, &mag_dummy[0], &info);
1049 TEUCHOS_TEST_FOR_EXCEPTION
1050 (info < 0, std::logic_error,
"Belos::PseudoBlockCGSolMgr::" 1051 "compute_condnum_tridiag_sym: LAPACK's _PTEQR failed with info = " 1052 << info <<
" < 0. This suggests there might be a bug in the way Belos " 1053 "is calling LAPACK. Please report this to the Belos developers.");
1054 lambda_min = Teuchos::as<ScalarType> (diag[N-1]);
1055 lambda_max = Teuchos::as<ScalarType> (diag[0]);
1062 if (STS::real (lambda_max) < STS::real (lambda_min)) {
1063 ConditionNumber = STS::one ();
1067 ConditionNumber = lambda_max / lambda_min;
ScaleType convertStringToScaleType(const std::string &scaleType)
Convert the given string to its ScaleType enum value.
Teuchos::RCP< const MV > R
The current residual.
Collection of types and exceptions used within the Belos solvers.
ScalarType getConditionEstimate() const
Gets the estimated condition number.
Belos's basic output manager for sending information of select verbosity levels to the appropriate ou...
virtual ~PseudoBlockCGSolMgr()
Destructor.
Class which manages the output and verbosity of the Belos solvers.
ScaleType
The type of scaling to use on the residual norm value.
PseudoBlockCGSolMgr(const Teuchos::RCP< LinearProblem< ScalarType, MV, OP > > &problem, const Teuchos::RCP< Teuchos::ParameterList > &pl)
This class implements the preconditioned Conjugate Gradient (CG) iteration.
Structure to contain pointers to CGIteration state variables.
Belos concrete class for performing the conjugate-gradient (CG) iteration.
Teuchos::RCP< StatusTestGenResNorm< ScalarType, MV, OP > > getResidualStatusTest() const
A factory class for generating StatusTestOutput objects.
PseudoBlockCGSolMgrLinearProblemFailure is thrown when the linear problem is not setup (i...
An implementation of StatusTestResNorm using a family of residual norms.
static const double convTol
Default convergence tolerance.
Belos::StatusTest class for specifying a maximum number of iterations.
Teuchos::RCP< const Teuchos::ParameterList > getCurrentParameters() const override
Get a parameter list containing the current parameters for this object.
A factory class for generating StatusTestOutput objects.
const LinearProblem< ScalarType, MV, OP > & getProblem() const override
Return a reference to the linear problem being solved by this solver manager.
Traits class which defines basic operations on multivectors.
The Belos::PseudoBlockCGSolMgr provides a powerful and fully-featured solver manager over the pseudo-...
Belos::StatusTest for logically combining several status tests.
This class implements the pseudo-block CG iteration, where the basic CG algorithm is performed on all...
A Belos::StatusTest class for specifying a maximum number of iterations.
ResetType
How to reset the solver.
Pure virtual base class which describes the basic interface for a solver manager. ...
Belos concrete class for performing a single-reduction conjugate-gradient (CG) iteration.
Teuchos::Array< Teuchos::RCP< Teuchos::Time > > getTimers() const
Return the timers for this object.
A linear system to solve, and its associated information.
Class which describes the linear problem to be solved by the iterative solver.
PseudoBlockCGSolMgrOrthoFailure(const std::string &what_arg)
bool isLOADetected() const override
Return whether a loss of accuracy was detected by this solver during the most current solve...
Teuchos::RCP< SolverManager< ScalarType, MV, OP > > clone() const override
clone for Inverted Injection (DII)
int getNumIters() const override
Get the iteration count for the most recent call to solve().
Type traits class that says whether Teuchos::LAPACK has a valid implementation for the given ScalarTy...
void setProblem(const Teuchos::RCP< LinearProblem< ScalarType, MV, OP > > &problem) override
Set the linear problem that needs to be solved.
ReturnType
Whether the Belos solve converged for all linear systems.
Teuchos::RCP< StatusTestGenResNorm< ScalarType, MV, OP > > getResidualStatusTest() const
Return the residual status test.
int setTolerance(MagnitudeType tolerance)
Set the value of the tolerance.
virtual ~PseudoBlockCGSolMgr()
Teuchos::RCP< StatusTestOutput< ScalarType, MV, OP > > create(const Teuchos::RCP< OutputManager< ScalarType > > &printer, Teuchos::RCP< StatusTest< ScalarType, MV, OP > > test, int mod, int printStates)
Create the StatusTestOutput object specified by the outputStyle.
PseudoBlockCGSolMgrLinearProblemFailure(const std::string &what_arg)
Belos::StatusTestResNorm for specifying general residual norm stopping criteria.
void reset(const ResetType type) override
Performs a reset of the solver manager specified by the ResetType. This informs the solver manager th...
A class for extending the status testing capabilities of Belos via logical combinations.
PseudoBlockCGSolMgrOrthoFailure is thrown when the orthogonalization manager is unable to generate or...
Class which defines basic traits for the operator type.
Belos concrete class for performing the pseudo-block CG iteration.
Parent class to all Belos exceptions.
Default parameters common to most Belos solvers.
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...
MagnitudeType achievedTol() const override
Tolerance achieved by the last solve() invocation.