42 #ifndef BELOS_BLOCK_CG_SOLMGR_HPP 43 #define BELOS_BLOCK_CG_SOLMGR_HPP 66 #include "Teuchos_BLAS.hpp" 67 #include "Teuchos_LAPACK.hpp" 68 #ifdef BELOS_TEUCHOS_TIME_MONITOR 69 # include "Teuchos_TimeMonitor.hpp" 71 #if defined(HAVE_TEUCHOSCORE_CXX11) 72 # include <type_traits> 73 #endif // defined(HAVE_TEUCHOSCORE_CXX11) 118 template<
class ScalarType,
class MV,
class OP,
119 const bool lapackSupportsScalarType =
124 static const bool requiresLapack =
134 const Teuchos::RCP<Teuchos::ParameterList>& pl) :
144 template<
class ScalarType,
class MV,
class OP>
171 typedef Teuchos::ScalarTraits<ScalarType> SCT;
172 typedef typename Teuchos::ScalarTraits<ScalarType>::magnitudeType MagnitudeType;
173 typedef Teuchos::ScalarTraits<MagnitudeType> MT;
224 const Teuchos::RCP<Teuchos::ParameterList> &pl );
239 Teuchos::RCP<const Teuchos::ParameterList> getValidParameters()
const;
250 Teuchos::Array<Teuchos::RCP<Teuchos::Time> >
getTimers()
const {
251 return Teuchos::tuple(timerSolve_);
281 void setParameters(
const Teuchos::RCP<Teuchos::ParameterList> ¶ms );
322 std::string description()
const;
329 Teuchos::RCP<LinearProblem<ScalarType,MV,OP> > problem_;
332 Teuchos::RCP<OutputManager<ScalarType> > printer_;
334 Teuchos::RCP<std::ostream> outputStream_;
340 Teuchos::RCP<StatusTest<ScalarType,MV,OP> > sTest_;
343 Teuchos::RCP<StatusTestMaxIters<ScalarType,MV,OP> > maxIterTest_;
346 Teuchos::RCP<StatusTestGenResNorm<ScalarType,MV,OP> > convTest_;
349 Teuchos::RCP<StatusTestOutput<ScalarType,MV,OP> > outputTest_;
352 Teuchos::RCP<MatOrthoManager<ScalarType,MV,OP> > ortho_;
355 Teuchos::RCP<Teuchos::ParameterList> params_;
360 static const MagnitudeType convtol_default_;
361 static const MagnitudeType orthoKappa_default_;
362 static const int maxIters_default_;
363 static const bool adaptiveBlockSize_default_;
364 static const bool showMaxResNormOnly_default_;
365 static const bool useSingleReduction_default_;
366 static const int blockSize_default_;
367 static const int verbosity_default_;
368 static const int outputStyle_default_;
369 static const int outputFreq_default_;
370 static const std::string resScale_default_;
371 static const std::string label_default_;
372 static const std::string orthoType_default_;
373 static const Teuchos::RCP<std::ostream> outputStream_default_;
380 MagnitudeType convtol_;
383 MagnitudeType orthoKappa_;
390 MagnitudeType achievedTol_;
399 int blockSize_, verbosity_, outputStyle_, outputFreq_;
400 bool adaptiveBlockSize_, showMaxResNormOnly_, useSingleReduction_;
401 std::string orthoType_, resScale_;
407 Teuchos::RCP<Teuchos::Time> timerSolve_;
415 template<
class ScalarType,
class MV,
class OP>
418 template<
class ScalarType,
class MV,
class OP>
421 template<
class ScalarType,
class MV,
class OP>
424 template<
class ScalarType,
class MV,
class OP>
427 template<
class ScalarType,
class MV,
class OP>
430 template<
class ScalarType,
class MV,
class OP>
433 template<
class ScalarType,
class MV,
class OP>
436 template<
class ScalarType,
class MV,
class OP>
439 template<
class ScalarType,
class MV,
class OP>
442 template<
class ScalarType,
class MV,
class OP>
445 template<
class ScalarType,
class MV,
class OP>
448 template<
class ScalarType,
class MV,
class OP>
451 template<
class ScalarType,
class MV,
class OP>
454 template<
class ScalarType,
class MV,
class OP>
459 template<
class ScalarType,
class MV,
class OP>
461 outputStream_(outputStream_default_),
462 convtol_(convtol_default_),
463 orthoKappa_(orthoKappa_default_),
464 achievedTol_(Teuchos::ScalarTraits<MagnitudeType>::zero()),
465 maxIters_(maxIters_default_),
467 blockSize_(blockSize_default_),
468 verbosity_(verbosity_default_),
469 outputStyle_(outputStyle_default_),
470 outputFreq_(outputFreq_default_),
471 adaptiveBlockSize_(adaptiveBlockSize_default_),
472 showMaxResNormOnly_(showMaxResNormOnly_default_),
473 useSingleReduction_(useSingleReduction_default_),
474 orthoType_(orthoType_default_),
475 resScale_(resScale_default_),
476 label_(label_default_),
482 template<
class ScalarType,
class MV,
class OP>
485 const Teuchos::RCP<Teuchos::ParameterList> &pl) :
487 outputStream_(outputStream_default_),
488 convtol_(convtol_default_),
489 orthoKappa_(orthoKappa_default_),
490 achievedTol_(Teuchos::ScalarTraits<MagnitudeType>::zero()),
491 maxIters_(maxIters_default_),
493 blockSize_(blockSize_default_),
494 verbosity_(verbosity_default_),
495 outputStyle_(outputStyle_default_),
496 outputFreq_(outputFreq_default_),
497 adaptiveBlockSize_(adaptiveBlockSize_default_),
498 showMaxResNormOnly_(showMaxResNormOnly_default_),
499 useSingleReduction_(useSingleReduction_default_),
500 orthoType_(orthoType_default_),
501 resScale_(resScale_default_),
502 label_(label_default_),
505 TEUCHOS_TEST_FOR_EXCEPTION(problem_.is_null(), std::invalid_argument,
506 "BlockCGSolMgr's constructor requires a nonnull LinearProblem instance.");
511 if (! pl.is_null()) {
516 template<
class ScalarType,
class MV,
class OP>
522 if (params_ == Teuchos::null) {
523 params_ = Teuchos::rcp(
new Teuchos::ParameterList(*getValidParameters()) );
526 params->validateParameters(*getValidParameters());
530 if (params->isParameter(
"Maximum Iterations")) {
531 maxIters_ = params->get(
"Maximum Iterations",maxIters_default_);
534 params_->set(
"Maximum Iterations", maxIters_);
535 if (maxIterTest_!=Teuchos::null)
536 maxIterTest_->setMaxIters( maxIters_ );
540 if (params->isParameter(
"Block Size")) {
541 blockSize_ = params->get(
"Block Size",blockSize_default_);
542 TEUCHOS_TEST_FOR_EXCEPTION(blockSize_ <= 0, std::invalid_argument,
543 "Belos::BlockCGSolMgr: \"Block Size\" must be strictly positive.");
546 params_->set(
"Block Size", blockSize_);
550 if (params->isParameter(
"Adaptive Block Size")) {
551 adaptiveBlockSize_ = params->get(
"Adaptive Block Size",adaptiveBlockSize_default_);
554 params_->set(
"Adaptive Block Size", adaptiveBlockSize_);
558 if (params->isParameter(
"Use Single Reduction")) {
559 useSingleReduction_ = params->get(
"Use Single Reduction", useSingleReduction_default_);
563 if (params->isParameter(
"Timer Label")) {
564 std::string tempLabel = params->get(
"Timer Label", label_default_);
567 if (tempLabel != label_) {
569 params_->set(
"Timer Label", label_);
570 std::string solveLabel = label_ +
": BlockCGSolMgr total solve time";
571 #ifdef BELOS_TEUCHOS_TIME_MONITOR 572 timerSolve_ = Teuchos::TimeMonitor::getNewCounter(solveLabel);
574 if (ortho_ != Teuchos::null) {
575 ortho_->setLabel( label_ );
581 if (params->isParameter(
"Orthogonalization")) {
582 std::string tempOrthoType = params->get(
"Orthogonalization",orthoType_default_);
583 TEUCHOS_TEST_FOR_EXCEPTION( tempOrthoType !=
"DGKS" && tempOrthoType !=
"ICGS" && tempOrthoType !=
"IMGS",
584 std::invalid_argument,
585 "Belos::BlockCGSolMgr: \"Orthogonalization\" must be either \"DGKS\", \"ICGS\", or \"IMGS\".");
586 if (tempOrthoType != orthoType_) {
587 orthoType_ = tempOrthoType;
588 params_->set(
"Orthogonalization", orthoType_);
590 if (orthoType_==
"DGKS") {
591 if (orthoKappa_ <= 0) {
599 else if (orthoType_==
"ICGS") {
602 else if (orthoType_==
"IMGS") {
609 if (params->isParameter(
"Orthogonalization Constant")) {
610 orthoKappa_ = params->get(
"Orthogonalization Constant",orthoKappa_default_);
613 params_->set(
"Orthogonalization Constant",orthoKappa_);
614 if (orthoType_==
"DGKS") {
615 if (orthoKappa_ > 0 && ortho_ != Teuchos::null) {
622 if (params->isParameter(
"Verbosity")) {
623 if (Teuchos::isParameterType<int>(*params,
"Verbosity")) {
624 verbosity_ = params->get(
"Verbosity", verbosity_default_);
626 verbosity_ = (int)Teuchos::getParameter<Belos::MsgType>(*params,
"Verbosity");
630 params_->set(
"Verbosity", verbosity_);
631 if (printer_ != Teuchos::null)
632 printer_->setVerbosity(verbosity_);
636 if (params->isParameter(
"Output Style")) {
637 if (Teuchos::isParameterType<int>(*params,
"Output Style")) {
638 outputStyle_ = params->get(
"Output Style", outputStyle_default_);
640 outputStyle_ = (int)Teuchos::getParameter<Belos::OutputType>(*params,
"Output Style");
644 params_->set(
"Output Style", outputStyle_);
645 outputTest_ = Teuchos::null;
649 if (params->isParameter(
"Output Stream")) {
650 outputStream_ = Teuchos::getParameter<Teuchos::RCP<std::ostream> >(*params,
"Output Stream");
653 params_->set(
"Output Stream", outputStream_);
654 if (printer_ != Teuchos::null)
655 printer_->setOStream( outputStream_ );
660 if (params->isParameter(
"Output Frequency")) {
661 outputFreq_ = params->get(
"Output Frequency", outputFreq_default_);
665 params_->set(
"Output Frequency", outputFreq_);
666 if (outputTest_ != Teuchos::null)
667 outputTest_->setOutputFrequency( outputFreq_ );
671 if (printer_ == Teuchos::null) {
680 if (params->isParameter(
"Convergence Tolerance")) {
681 convtol_ = params->get(
"Convergence Tolerance",convtol_default_);
684 params_->set(
"Convergence Tolerance", convtol_);
685 if (convTest_ != Teuchos::null)
689 if (params->isParameter(
"Show Maximum Residual Norm Only")) {
690 showMaxResNormOnly_ = Teuchos::getParameter<bool>(*params,
"Show Maximum Residual Norm Only");
693 params_->set(
"Show Maximum Residual Norm Only", showMaxResNormOnly_);
694 if (convTest_ != Teuchos::null)
695 convTest_->setShowMaxResNormOnly( showMaxResNormOnly_ );
699 bool newResTest =
false;
701 std::string tempResScale = resScale_;
702 if (params->isParameter (
"Implicit Residual Scaling")) {
703 tempResScale = params->get<std::string> (
"Implicit Residual Scaling");
707 if (resScale_ != tempResScale) {
710 resScale_ = tempResScale;
713 params_->set (
"Implicit Residual Scaling", resScale_);
715 if (! convTest_.is_null ()) {
719 catch (std::exception& e) {
730 if (maxIterTest_ == Teuchos::null)
734 if (convTest_.is_null () || newResTest) {
735 convTest_ = rcp (
new StatusTestResNorm_t (convtol_, 1, showMaxResNormOnly_));
739 if (sTest_.is_null () || newResTest)
740 sTest_ = Teuchos::rcp(
new StatusTestCombo_t( StatusTestCombo_t::OR, maxIterTest_, convTest_ ) );
742 if (outputTest_.is_null () || newResTest) {
750 std::string solverDesc =
" Block CG ";
751 outputTest_->setSolverDesc( solverDesc );
756 if (ortho_ == Teuchos::null) {
757 params_->set(
"Orthogonalization", orthoType_);
758 if (orthoType_==
"DGKS") {
759 if (orthoKappa_ <= 0) {
767 else if (orthoType_==
"ICGS") {
770 else if (orthoType_==
"IMGS") {
774 TEUCHOS_TEST_FOR_EXCEPTION(orthoType_!=
"ICGS"&&orthoType_!=
"DGKS"&&orthoType_!=
"IMGS",std::logic_error,
775 "Belos::BlockCGSolMgr(): Invalid orthogonalization type.");
780 if (timerSolve_ == Teuchos::null) {
781 std::string solveLabel = label_ +
": BlockCGSolMgr total solve time";
782 #ifdef BELOS_TEUCHOS_TIME_MONITOR 783 timerSolve_ = Teuchos::TimeMonitor::getNewCounter(solveLabel);
792 template<
class ScalarType,
class MV,
class OP>
793 Teuchos::RCP<const Teuchos::ParameterList>
796 static Teuchos::RCP<const Teuchos::ParameterList> validPL;
799 if(is_null(validPL)) {
800 Teuchos::RCP<Teuchos::ParameterList> pl = Teuchos::parameterList();
801 pl->set(
"Convergence Tolerance", convtol_default_,
802 "The relative residual tolerance that needs to be achieved by the\n" 803 "iterative solver in order for the linear system to be declared converged.");
804 pl->set(
"Maximum Iterations", maxIters_default_,
805 "The maximum number of block iterations allowed for each\n" 806 "set of RHS solved.");
807 pl->set(
"Block Size", blockSize_default_,
808 "The number of vectors in each block.");
809 pl->set(
"Adaptive Block Size", adaptiveBlockSize_default_,
810 "Whether the solver manager should adapt to the block size\n" 811 "based on the number of RHS to solve.");
812 pl->set(
"Verbosity", verbosity_default_,
813 "What type(s) of solver information should be outputted\n" 814 "to the output stream.");
815 pl->set(
"Output Style", outputStyle_default_,
816 "What style is used for the solver information outputted\n" 817 "to the output stream.");
818 pl->set(
"Output Frequency", outputFreq_default_,
819 "How often convergence information should be outputted\n" 820 "to the output stream.");
821 pl->set(
"Output Stream", outputStream_default_,
822 "A reference-counted pointer to the output stream where all\n" 823 "solver output is sent.");
824 pl->set(
"Show Maximum Residual Norm Only", showMaxResNormOnly_default_,
825 "When convergence information is printed, only show the maximum\n" 826 "relative residual norm when the block size is greater than one.");
827 pl->set(
"Use Single Reduction", useSingleReduction_default_,
828 "Use single reduction iteration when the block size is one.");
829 pl->set(
"Implicit Residual Scaling", resScale_default_,
830 "The type of scaling used in the residual convergence test.");
831 pl->set(
"Timer Label", label_default_,
832 "The string to use as a prefix for the timer labels.");
833 pl->set(
"Orthogonalization", orthoType_default_,
834 "The type of orthogonalization to use: DGKS, ICGS, or IMGS.");
835 pl->set(
"Orthogonalization Constant",orthoKappa_default_,
836 "The constant used by DGKS orthogonalization to determine\n" 837 "whether another step of classical Gram-Schmidt is necessary.");
845 template<
class ScalarType,
class MV,
class OP>
849 using Teuchos::rcp_const_cast;
850 using Teuchos::rcp_dynamic_cast;
857 setParameters(Teuchos::parameterList(*getValidParameters()));
860 Teuchos::BLAS<int,ScalarType> blas;
861 Teuchos::LAPACK<int,ScalarType> lapack;
863 TEUCHOS_TEST_FOR_EXCEPTION( !problem_->isProblemSet(),
865 "Belos::BlockCGSolMgr::solve(): Linear problem is not ready, setProblem() " 866 "has not been called.");
870 int numRHS2Solve = MVT::GetNumberVecs( *(problem_->getRHS()) );
871 int numCurrRHS = ( numRHS2Solve < blockSize_) ? numRHS2Solve : blockSize_;
873 std::vector<int> currIdx, currIdx2;
878 if ( adaptiveBlockSize_ ) {
879 blockSize_ = numCurrRHS;
880 currIdx.resize( numCurrRHS );
881 currIdx2.resize( numCurrRHS );
882 for (
int i=0; i<numCurrRHS; ++i)
883 { currIdx[i] = startPtr+i; currIdx2[i]=i; }
887 currIdx.resize( blockSize_ );
888 currIdx2.resize( blockSize_ );
889 for (
int i=0; i<numCurrRHS; ++i)
890 { currIdx[i] = startPtr+i; currIdx2[i]=i; }
891 for (
int i=numCurrRHS; i<blockSize_; ++i)
892 { currIdx[i] = -1; currIdx2[i] = i; }
896 problem_->setLSIndex( currIdx );
900 Teuchos::ParameterList plist;
901 plist.set(
"Block Size",blockSize_);
904 outputTest_->reset();
908 bool isConverged =
true;
913 RCP<CGIteration<ScalarType,MV,OP> > block_cg_iter;
914 if (blockSize_ == 1) {
918 if (useSingleReduction_) {
921 outputTest_, plist));
926 outputTest_, plist));
937 #ifdef BELOS_TEUCHOS_TIME_MONITOR 938 Teuchos::TimeMonitor slvtimer(*timerSolve_);
941 while ( numRHS2Solve > 0 ) {
944 std::vector<int> convRHSIdx;
945 std::vector<int> currRHSIdx( currIdx );
946 currRHSIdx.resize(numCurrRHS);
949 block_cg_iter->resetNumIters();
952 outputTest_->resetNumCalls();
955 RCP<MV> R_0 = MVT::CloneViewNonConst( *(rcp_const_cast<MV>(problem_->getInitResVec())), currIdx );
960 block_cg_iter->initializeCG(newstate);
966 block_cg_iter->iterate();
970 if (convTest_->getStatus() ==
Passed) {
975 std::vector<int> convIdx =
976 rcp_dynamic_cast<conv_test_type>(convTest_)->convIndices();
981 if (convIdx.size() == currRHSIdx.size())
986 problem_->setCurrLS();
991 std::vector<int> unconvIdx(currRHSIdx.size());
992 for (
unsigned int i=0; i<currRHSIdx.size(); ++i) {
994 for (
unsigned int j=0; j<convIdx.size(); ++j) {
995 if (currRHSIdx[i] == convIdx[j]) {
1001 currIdx2[have] = currIdx2[i];
1002 currRHSIdx[have++] = currRHSIdx[i];
1007 currRHSIdx.resize(have);
1008 currIdx2.resize(have);
1011 problem_->setLSIndex( currRHSIdx );
1014 std::vector<MagnitudeType> norms;
1015 R_0 = MVT::CloneCopy( *(block_cg_iter->getNativeResiduals(&norms)),currIdx2 );
1016 for (
int i=0; i<have; ++i) { currIdx2[i] = i; }
1019 block_cg_iter->setBlockSize( have );
1024 block_cg_iter->initializeCG(defstate);
1030 else if (maxIterTest_->getStatus() ==
Passed) {
1031 isConverged =
false;
1039 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::logic_error,
1040 "Belos::BlockCGSolMgr::solve(): Neither the convergence test nor " 1041 "the maximum iteration count test passed. Please report this bug " 1042 "to the Belos developers.");
1045 catch (
const std::exception &e) {
1046 std::ostream& err = printer_->stream (
Errors);
1047 err <<
"Error! Caught std::exception in CGIteration::iterate() at " 1048 <<
"iteration " << block_cg_iter->getNumIters() << std::endl
1049 << e.what() << std::endl;
1056 problem_->setCurrLS();
1059 startPtr += numCurrRHS;
1060 numRHS2Solve -= numCurrRHS;
1061 if ( numRHS2Solve > 0 ) {
1062 numCurrRHS = ( numRHS2Solve < blockSize_) ? numRHS2Solve : blockSize_;
1064 if ( adaptiveBlockSize_ ) {
1065 blockSize_ = numCurrRHS;
1066 currIdx.resize( numCurrRHS );
1067 currIdx2.resize( numCurrRHS );
1068 for (
int i=0; i<numCurrRHS; ++i)
1069 { currIdx[i] = startPtr+i; currIdx2[i] = i; }
1072 currIdx.resize( blockSize_ );
1073 currIdx2.resize( blockSize_ );
1074 for (
int i=0; i<numCurrRHS; ++i)
1075 { currIdx[i] = startPtr+i; currIdx2[i] = i; }
1076 for (
int i=numCurrRHS; i<blockSize_; ++i)
1077 { currIdx[i] = -1; currIdx2[i] = i; }
1080 problem_->setLSIndex( currIdx );
1083 block_cg_iter->setBlockSize( blockSize_ );
1086 currIdx.resize( numRHS2Solve );
1097 #ifdef BELOS_TEUCHOS_TIME_MONITOR 1103 Teuchos::TimeMonitor::summarize( printer_->stream(TimingDetails) );
1108 numIters_ = maxIterTest_->getNumIters();
1114 const std::vector<MagnitudeType>* pTestValues =
1115 rcp_dynamic_cast<conv_test_type>(convTest_)->getTestValue();
1117 TEUCHOS_TEST_FOR_EXCEPTION(pTestValues == NULL, std::logic_error,
1118 "Belos::BlockCGSolMgr::solve(): The convergence test's getTestValue() " 1119 "method returned NULL. Please report this bug to the Belos developers.");
1121 TEUCHOS_TEST_FOR_EXCEPTION(pTestValues->size() < 1, std::logic_error,
1122 "Belos::BlockCGSolMgr::solve(): The convergence test's getTestValue() " 1123 "method returned a vector of length zero. Please report this bug to the " 1124 "Belos developers.");
1129 achievedTol_ = *std::max_element (pTestValues->begin(), pTestValues->end());
1139 template<
class ScalarType,
class MV,
class OP>
1142 std::ostringstream oss;
1143 oss <<
"Belos::BlockCGSolMgr<...,"<<Teuchos::ScalarTraits<ScalarType>::name()<<
">";
1145 oss <<
"Ortho Type='"<<orthoType_<<
"\', Block Size=" << blockSize_;
ScaleType convertStringToScaleType(const std::string &scaleType)
Convert the given string to its ScaleType enum value.
Teuchos::RCP< const MV > R
The current residual.
void setProblem(const Teuchos::RCP< LinearProblem< ScalarType, MV, OP > > &problem)
Set the linear problem that needs to be solved.
Collection of types and exceptions used within the Belos solvers.
Belos's basic output manager for sending information of select verbosity levels to the appropriate ou...
Class which manages the output and verbosity of the Belos solvers.
int getNumIters() const
Get the iteration count for the most recent call to solve().
Teuchos::Array< Teuchos::RCP< Teuchos::Time > > getTimers() const
Return the timers for this object.
ScaleType
The type of scaling to use on the residual norm value.
MagnitudeType achievedTol() const
Tolerance achieved by the last solve() invocation.
const LinearProblem< ScalarType, MV, OP > & getProblem() const
Return a reference to the linear problem being solved by this solver manager.
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.
A factory class for generating StatusTestOutput objects.
Belos concrete class for performing the block conjugate-gradient (CG) iteration.
An implementation of StatusTestResNorm using a family of residual norms.
The Belos::BlockCGSolMgr provides a powerful and fully-featured solver manager over the CG and BlockC...
Belos::StatusTest class for specifying a maximum number of iterations.
BlockCGSolMgrLinearProblemFailure(const std::string &what_arg)
BlockCGSolMgrLinearProblemFailure is thrown when the linear problem is not setup (i.e.
A factory class for generating StatusTestOutput objects.
Iterated Modified Gram-Schmidt (IMGS) implementation of the Belos::OrthoManager class.
Teuchos::RCP< const Teuchos::ParameterList > getCurrentParameters() const
Get a parameter list containing the current parameters for this object.
BlockCGSolMgr(const Teuchos::RCP< LinearProblem< ScalarType, MV, OP > > &problem, const Teuchos::RCP< Teuchos::ParameterList > &pl)
Traits class which defines basic operations on multivectors.
Belos::StatusTest for logically combining several status tests.
virtual ~BlockCGSolMgr()
Destructor.
Classical Gram-Schmidt (with DGKS correction) implementation of the Belos::OrthoManager class...
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.
A linear system to solve, and its associated information.
Class which describes the linear problem to be solved by the iterative solver.
BlockCGSolMgrOrthoFailure is thrown when the orthogonalization manager is unable to generate orthonor...
Type traits class that says whether Teuchos::LAPACK has a valid implementation for the given ScalarTy...
bool isLOADetected() const
Return whether a loss of accuracy was detected by this solver during the most current solve...
ReturnType
Whether the Belos solve converged for all linear systems.
Iterated Classical Gram-Schmidt (ICGS) implementation of the Belos::OrthoManager class.
An implementation of the Belos::MatOrthoManager that performs orthogonalization using multiple steps ...
BlockCGSolMgrOrthoFailure(const std::string &what_arg)
An implementation of the Belos::MatOrthoManager that performs orthogonalization using multiple steps ...
int setTolerance(MagnitudeType tolerance)
Set the value of the tolerance.
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.
Belos::StatusTestResNorm for specifying general residual norm stopping criteria.
An implementation of the Belos::MatOrthoManager that performs orthogonalization using (potentially) m...
A class for extending the status testing capabilities of Belos via logical combinations.
Class which defines basic traits for the operator type.
Parent class to all Belos exceptions.
This class implements the preconditioned single-reduction Conjugate Gradient (CG) iteration...
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...
void reset(const ResetType type)
Performs a reset of the solver manager specified by the ResetType. This informs the solver manager th...
Stub implementation of BlockCGIter, for ScalarType types for which Teuchos::LAPACK does NOT have a va...