42 #ifndef BELOS_PCPG_SOLMGR_HPP
43 #define BELOS_PCPG_SOLMGR_HPP
64 #ifdef BELOS_TEUCHOS_TIME_MONITOR
67 #if defined(HAVE_TEUCHOSCORE_CXX11)
68 # include <type_traits>
69 #endif // defined(HAVE_TEUCHOSCORE_CXX11)
149 template<
class ScalarType,
class MV,
class OP,
150 const bool supportsScalarType =
155 Belos::Details::LapackSupportsScalar<ScalarType>::value &&
156 ! Teuchos::ScalarTraits<ScalarType>::isComplex>
180 template<
class ScalarType,
class MV,
class OP>
272 return Teuchos::tuple(timerSolve_);
343 std::string description()
const;
373 static constexpr
int maxIters_default_ = 1000;
374 static constexpr
int deflatedBlocks_default_ = 2;
375 static constexpr
int savedBlocks_default_ = 16;
378 static constexpr
int outputFreq_default_ = -1;
379 static constexpr
const char * label_default_ =
"Belos";
380 static constexpr
const char * orthoType_default_ =
"ICGS";
381 static constexpr std::ostream * outputStream_default_ = &std::cout;
402 int deflatedBlocks_, savedBlocks_,
verbosity_, outputStyle_, outputFreq_;
421 template<
class ScalarType,
class MV,
class OP>
423 outputStream_(Teuchos::
rcp(outputStream_default_,false)),
428 maxIters_(maxIters_default_),
429 deflatedBlocks_(deflatedBlocks_default_),
430 savedBlocks_(savedBlocks_default_),
431 verbosity_(verbosity_default_),
432 outputStyle_(outputStyle_default_),
433 outputFreq_(outputFreq_default_),
434 orthoType_(orthoType_default_),
436 label_(label_default_),
442 template<
class ScalarType,
class MV,
class OP>
447 outputStream_(Teuchos::
rcp(outputStream_default_,false)),
453 maxIters_(maxIters_default_),
454 deflatedBlocks_(deflatedBlocks_default_),
455 savedBlocks_(savedBlocks_default_),
456 verbosity_(verbosity_default_),
457 outputStyle_(outputStyle_default_),
458 outputFreq_(outputFreq_default_),
459 orthoType_(orthoType_default_),
461 label_(label_default_),
465 problem_.is_null (), std::invalid_argument,
466 "Belos::PCPGSolMgr two-argument constructor: "
467 "'problem' is null. You must supply a non-null Belos::LinearProblem "
468 "instance when calling this constructor.");
477 template<
class ScalarType,
class MV,
class OP>
490 maxIters_ = params->
get(
"Maximum Iterations",maxIters_default_);
493 params_->set(
"Maximum Iterations", maxIters_);
495 maxIterTest_->setMaxIters( maxIters_ );
500 savedBlocks_ = params->
get(
"Num Saved Blocks",savedBlocks_default_);
502 "Belos::PCPGSolMgr: \"Num Saved Blocks\" must be strictly positive.");
509 params_->set(
"Num Saved Blocks", savedBlocks_);
512 deflatedBlocks_ = params->
get(
"Num Deflated Blocks",deflatedBlocks_default_);
514 "Belos::PCPGSolMgr: \"Num Deflated Blocks\" must be positive.");
517 "Belos::PCPGSolMgr: \"Num Deflated Blocks\" must be <= \"Num Saved Blocks\".");
521 params_->set(
"Num Deflated Blocks", static_cast<int>(deflatedBlocks_));
526 std::string tempLabel = params->
get(
"Timer Label", label_default_);
529 if (tempLabel != label_) {
531 params_->set(
"Timer Label", label_);
532 std::string solveLabel = label_ +
": PCPGSolMgr total solve time";
533 #ifdef BELOS_TEUCHOS_TIME_MONITOR
537 ortho_->setLabel( label_ );
544 if (Teuchos::isParameterType<int>(*params,
"Verbosity")) {
545 verbosity_ = params->
get(
"Verbosity", verbosity_default_);
547 verbosity_ = (int)Teuchos::getParameter<Belos::MsgType>(*params,
"Verbosity");
551 params_->set(
"Verbosity", verbosity_);
553 printer_->setVerbosity(verbosity_);
558 if (Teuchos::isParameterType<int>(*params,
"Output Style")) {
559 outputStyle_ = params->
get(
"Output Style", outputStyle_default_);
561 outputStyle_ = (int)Teuchos::getParameter<Belos::OutputType>(*params,
"Output Style");
565 params_->set(
"Output Style", outputStyle_);
571 outputStream_ = Teuchos::getParameter<Teuchos::RCP<std::ostream> >(*params,
"Output Stream");
574 params_->set(
"Output Stream", outputStream_);
576 printer_->setOStream( outputStream_ );
582 outputFreq_ = params->
get(
"Output Frequency", outputFreq_default_);
586 params_->set(
"Output Frequency", outputFreq_);
588 outputTest_->setOutputFrequency( outputFreq_ );
597 bool changedOrthoType =
false;
599 std::string tempOrthoType = params->
get(
"Orthogonalization",orthoType_default_);
600 if (tempOrthoType != orthoType_) {
601 orthoType_ = tempOrthoType;
602 changedOrthoType =
true;
605 params_->set(
"Orthogonalization", orthoType_);
608 if (params->
isParameter(
"Orthogonalization Constant")) {
610 orthoKappa_ = params->
get (
"Orthogonalization Constant",
614 orthoKappa_ = params->
get (
"Orthogonalization Constant",
619 params_->set(
"Orthogonalization Constant",orthoKappa_);
620 if (orthoType_==
"DGKS") {
621 if (orthoKappa_ > 0 && ortho_ !=
Teuchos::null && !changedOrthoType) {
631 if (orthoType_==
"DGKS" && orthoKappa_ > 0) {
632 paramsOrtho->
set (
"depTol", orthoKappa_ );
643 if (params->
isParameter(
"Convergence Tolerance")) {
645 convtol_ = params->
get (
"Convergence Tolerance",
653 params_->set(
"Convergence Tolerance", convtol_);
655 convTest_->setTolerance( convtol_ );
665 convTest_ =
Teuchos::rcp(
new StatusTestResNorm_t( convtol_, 1 ) );
667 sTest_ =
Teuchos::rcp(
new StatusTestCombo_t( StatusTestCombo_t::OR, maxIterTest_, convTest_ ) );
675 std::string solverDesc =
" PCPG ";
676 outputTest_->setSolverDesc( solverDesc );
680 std::string solveLabel = label_ +
": PCPGSolMgr total solve time";
681 #ifdef BELOS_TEUCHOS_TIME_MONITOR
691 template<
class ScalarType,
class MV,
class OP>
700 "The relative residual tolerance that needs to be achieved by the\n"
701 "iterative solver in order for the linear system to be declared converged.");
702 pl->
set(
"Maximum Iterations", static_cast<int>(maxIters_default_),
703 "The maximum number of iterations allowed for each\n"
704 "set of RHS solved.");
705 pl->
set(
"Num Deflated Blocks", static_cast<int>(deflatedBlocks_default_),
706 "The maximum number of vectors in the seed subspace." );
707 pl->
set(
"Num Saved Blocks", static_cast<int>(savedBlocks_default_),
708 "The maximum number of vectors saved from old Krylov subspaces." );
709 pl->
set(
"Verbosity", static_cast<int>(verbosity_default_),
710 "What type(s) of solver information should be outputted\n"
711 "to the output stream.");
712 pl->
set(
"Output Style", static_cast<int>(outputStyle_default_),
713 "What style is used for the solver information outputted\n"
714 "to the output stream.");
715 pl->
set(
"Output Frequency", static_cast<int>(outputFreq_default_),
716 "How often convergence information should be outputted\n"
717 "to the output stream.");
719 "A reference-counted pointer to the output stream where all\n"
720 "solver output is sent.");
721 pl->
set(
"Timer Label", static_cast<const char *>(label_default_),
722 "The string to use as a prefix for the timer labels.");
723 pl->
set(
"Orthogonalization", static_cast<const char *>(orthoType_default_),
724 "The type of orthogonalization to use: DGKS, ICGS, IMGS");
726 "The constant used by DGKS orthogonalization to determine\n"
727 "whether another step of classical Gram-Schmidt is necessary.");
735 template<
class ScalarType,
class MV,
class OP>
739 if (!isSet_) { setParameters( params_ ); }
747 "Belos::PCPGSolMgr::solve(): Linear problem is not a valid object.");
750 "Belos::PCPGSolMgr::solve(): Linear problem is not ready, setProblem() has not been called.");
753 int numRHS2Solve = MVT::GetNumberVecs( *(problem_->getRHS()) );
754 std::vector<int> currIdx(1);
760 problem_->setLSIndex( currIdx );
763 bool isConverged =
true;
768 plist.
set(
"Saved Blocks", savedBlocks_);
769 plist.
set(
"Block Size", 1);
770 plist.
set(
"Keep Diagonal",
true);
771 plist.
set(
"Initialize Diagonal",
true);
782 #ifdef BELOS_TEUCHOS_TIME_MONITOR
785 while ( numRHS2Solve > 0 ) {
788 outputTest_->reset();
792 R_ = MVT::Clone( *(problem_->getRHS()), 1 );
794 problem_->computeCurrResVec( &*R_ );
806 std::vector<MagnitudeType> rnorm0(1);
807 MVT::MvNorm( *R_, rnorm0 );
810 std::cout <<
"Solver Manager: dimU_ = " << dimU_ << std::endl;
814 std::vector<int> active_columns( dimU_ );
815 for (
int i=0; i < dimU_; ++i) active_columns[i] = i;
816 Uactive = MVT::CloneView(*U_, active_columns);
817 Cactive = MVT::CloneView(*C_, active_columns);
820 std::cout <<
" Solver Manager : check duality of seed basis " << std::endl;
822 MVT::MvTransMv( one, *Uactive, *Cactive, H );
823 H.
print( std::cout );
826 MVT::MvTransMv( one, *Uactive, *R_, Z );
828 MVT::MvTimesMatAddMv( one, *Uactive, Z, zero, *tempU );
829 MVT::MvAddMv( one, *tempU, one, *cur_soln_vec, *cur_soln_vec );
830 MVT::MvTimesMatAddMv( one, *Cactive, Z, zero, *tempU );
831 MVT::MvAddMv( -one, *tempU, one, *R_, *R_ );
832 std::vector<MagnitudeType> rnorm(1);
833 MVT::MvNorm( *R_, rnorm );
834 if( rnorm[0] < rnorm0[0] * .001 ){
835 MVT::MvTransMv( one, *Uactive, *R_, Z );
836 MVT::MvTimesMatAddMv( one, *Uactive, Z, zero, *tempU );
837 MVT::MvAddMv( one, *tempU, one, *cur_soln_vec, *cur_soln_vec );
838 MVT::MvTimesMatAddMv( one, *Cactive, Z, zero, *tempU );
839 MVT::MvAddMv( -one, *tempU, one, *R_, *R_ );
856 if( dimU_ > 0 ) pcpgState.
curDim = dimU_;
857 pcpg_iter->initialize(pcpgState);
863 if( !dimU_ ) printer_->stream(
Debug) <<
" No recycled subspace available for RHS index " << currIdx[0] << std::endl << std::endl;
864 pcpg_iter->resetNumIters();
866 if( dimU_ > savedBlocks_ )
867 std::cout <<
"Error: dimU_ = " << dimU_ <<
" > savedBlocks_ = " << savedBlocks_ << std::endl;
873 if( debug ) printf(
"********** Calling iterate...\n");
874 pcpg_iter->iterate();
881 if ( convTest_->getStatus() ==
Passed ) {
890 else if ( maxIterTest_->getStatus() ==
Passed ) {
905 "Belos::PCPGSolMgr::solve(): Invalid return from PCPGIter::iterate().");
911 sTest_->checkStatus( &*pcpg_iter );
912 if (convTest_->getStatus() !=
Passed)
916 catch (
const std::exception &e) {
917 printer_->stream(
Errors) <<
"Error! Caught exception in PCPGIter::iterate() at iteration "
918 << pcpg_iter->getNumIters() << std::endl
919 << e.what() << std::endl;
926 problem_->updateSolution( update,
true );
929 problem_->setCurrLS();
937 std::cout <<
"SolverManager: dimU_ " << dimU_ <<
" prevUdim= " << q << std::endl;
939 if( q > deflatedBlocks_ )
940 std::cout <<
"SolverManager: Error deflatedBlocks = " << deflatedBlocks_ << std::endl;
951 rank = ARRQR(dimU_,q, *oldState.
D );
953 std::cout <<
" rank decreased in ARRQR, something to do? " << std::endl;
959 if( dimU_ > deflatedBlocks_ ){
961 if( !deflatedBlocks_ ){
964 dimU_ = deflatedBlocks_;
968 bool Harmonic =
false;
972 std::vector<int> active_cols( dimU_ );
973 for (
int i=0; i < dimU_; ++i) active_cols[i] = i;
976 Uorth = MVT::CloneCopy(*C_, active_cols);
979 Uorth = MVT::CloneCopy(*U_, active_cols);
984 rank = ortho_->normalize(*Uorth,
Teuchos::rcp(&R,
false));
991 "Belos::PCPGSolMgr::solve(): Failed to compute orthonormal basis for initial recycled subspace.");
1000 if( problem_->isHermitian() ) lrwork = dimU_;
1001 std::vector<ScalarType> work(lwork);
1002 std::vector<ScalarType> Svec(dimU_);
1003 std::vector<ScalarType> rwork(lrwork);
1004 lapack.
GESVD(
'N',
'O',
1013 "Belos::PCPGSolMgr::solve(): LAPACK _GESVD failed to compute singular values.");
1015 if( work[0] != 67. * dimU_ )
1016 std::cout <<
" SVD " << dimU_ <<
" lwork " << work[0] << std::endl;
1017 for(
int i=0; i< dimU_; i++)
1018 std::cout << i <<
" " << Svec[i] << std::endl;
1022 int startRow = 0, startCol = 0;
1024 startCol = dimU_ - deflatedBlocks_;
1032 std::vector<int> active_columns( dimU_ );
1033 std::vector<int> def_cols( deflatedBlocks_ );
1034 for (
int i=0; i < dimU_; ++i) active_columns[i] = i;
1035 for (
int i=0; i < deflatedBlocks_; ++i) def_cols[i] = i;
1039 MVT::MvTimesMatAddMv( one, *Ucopy, V, zero, *Uactive );
1044 MVT::MvTimesMatAddMv( one, *Ccopy, V, zero, *Cactive );
1047 dimU_ = deflatedBlocks_;
1049 printer_->stream(
Debug) <<
" Generated recycled subspace using RHS index " << currIdx[0] <<
" of dimension " << dimU_ << std::endl << std::endl;
1052 problem_->setCurrLS();
1056 if ( numRHS2Solve > 0 ) {
1060 problem_->setLSIndex( currIdx );
1063 currIdx.resize( numRHS2Solve );
1072 #ifdef BELOS_TEUCHOS_TIME_MONITOR
1082 using Teuchos::rcp_dynamic_cast;
1085 const std::vector<MagnitudeType>* pTestValues =
1086 rcp_dynamic_cast<conv_test_type>(convTest_)->getTestValue();
1089 "Belos::PCPGSolMgr::solve(): The convergence test's getTestValue() "
1090 "method returned NULL. Please report this bug to the Belos developers.");
1093 "Belos::PCPGSolMgr::solve(): The convergence test's getTestValue() "
1094 "method returned a vector of length zero. Please report this bug to the "
1095 "Belos developers.");
1100 achievedTol_ = *std::max_element (pTestValues->begin(), pTestValues->end());
1104 numIters_ = maxIterTest_->getNumIters();
1115 template<
class ScalarType,
class MV,
class OP>
1126 std::vector<int> curind(1);
1127 std::vector<int> ipiv(p - q);
1128 std::vector<ScalarType> Pivots(p);
1130 ScalarType rteps = 1.5e-8;
1133 for( i = q ; i < p ; i++ ){
1136 RCP<MV> P = MVT::CloneViewNonConst(*U_,curind);
1137 RCP<MV> AP = MVT::CloneViewNonConst(*C_,curind);
1139 MVT::MvAddMv( anorm(0,0), *P, zero, *AP, *P );
1140 MVT::MvAddMv( zero, *P, anorm(0,0), *AP, *AP );
1144 for( i = q ; i < p ; i++ ){
1145 if( q < i && i < p-1 ){
1148 for( j = i+1 ; j < p ; j++ ){
1149 const int k = ipiv[j-q];
1150 if( Pivots[k] > Pivots[l] ){
1157 ipiv[imax-q] = ipiv[i-q];
1163 if( Pivots[k] > 1.5625e-2 ){
1164 anorm(0,0) = Pivots[k];
1168 RCP<const MV> P = MVT::CloneView(*U_,curind);
1169 RCP<const MV> AP = MVT::CloneView(*C_,curind);
1170 MVT::MvTransMv( one, *P, *AP, anorm );
1173 if( rteps <= anorm(0,0) && anorm(0,0) < 9.765625e-4){
1181 std::cout <<
"ARRQR: Bad case not implemented" << std::endl;
1183 if( anorm(0,0) < rteps ){
1184 std::cout <<
"ARRQR : deficient case not implemented " << std::endl;
1192 RCP<MV> P = MVT::CloneViewNonConst(*U_,curind);
1193 RCP<MV> AP = MVT::CloneViewNonConst(*C_,curind);
1194 MVT::MvAddMv( anorm(0,0), *P, zero, *AP, *P );
1195 MVT::MvAddMv( zero, *P, anorm(0,0), *AP, *AP );
1199 P = MVT::CloneViewNonConst(*U_,curind);
1200 AP = MVT::CloneViewNonConst(*C_,curind);
1201 for( j = i+1 ; j < p ; j++ ){
1204 RCP<MV> Q = MVT::CloneViewNonConst(*U_,curind);
1205 MVT::MvTransMv( one, *Q, *AP, alpha);
1206 MVT::MvAddMv( -alpha(0,0), *P, one, *Q, *Q );
1208 RCP<MV> AQ = MVT::CloneViewNonConst(*C_,curind);
1209 MVT::MvAddMv( -alpha(0,0), *AP, one, *AQ, *AQ );
1211 gamma(0,0) = ( Pivots[l] - alpha(0,0))*( Pivots[l] + alpha(0,0));
1212 if( gamma(0,0) > 0){
1224 template<
class ScalarType,
class MV,
class OP>
1227 std::ostringstream oss;
1230 oss <<
"Ortho Type='"<<orthoType_;
static const double orthoKappa
DGKS orthogonalization constant.
ScalarType * values() const
Collection of types and exceptions used within the Belos solvers.
int prevUdim
Number of block columns in matrices C and U before current iteration.
bool isLOADetected() const
Return whether a loss of accuracy was detected by this solver during the most current solve...
Belos's basic output manager for sending information of select verbosity levels to the appropriate ou...
PCPGSolMgr(const Teuchos::RCP< LinearProblem< ScalarType, MV, OP > > &problem, const Teuchos::RCP< Teuchos::ParameterList > &pl)
Class which manages the output and verbosity of the Belos solvers.
static const bool scalarTypeIsSupported
bool is_null(const boost::shared_ptr< T > &p)
Teuchos::RCP< StatusTestOutput< ScalarType, MV, OP > > outputTest_
Belos concrete class to iterate Preconditioned Conjugate Projected Gradients.
int numIters_
Number of iterations taken by the last solve() invocation.
PCPGSolMgrOrthoFailure is thrown when the orthogonalization manager is unable to generate orthonormal...
Teuchos::RCP< MV > R
The current residual.
T & get(ParameterList &l, const std::string &name)
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
bool is_null(const std::shared_ptr< T > &p)
Teuchos::RCP< MV > C
C = AU, U spans recycled subspace.
Base class for Belos::SolverManager subclasses which normally can only compile with real ScalarType t...
PCPGSolMgrRecyclingFailure is thrown when any problem occurs in using/creating the recycling subspace...
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
A factory class for generating StatusTestOutput objects.
virtual std::ostream & print(std::ostream &os) const
int curDim
The current dimension of the reduction.
An implementation of StatusTestResNorm using a family of residual norms.
PCPGSolMgrOrthoFailure(const std::string &what_arg)
int maxIters_
Maximum iteration count (read from parameter list).
const LinearProblem< ScalarType, MV, OP > & getProblem() const
Get current linear problem being solved for in this object.
MagnitudeType orthoKappa_
Orthogonalization parameter (read from parameter list).
Structure to contain pointers to PCPGIter state variables.
Teuchos::RCP< Teuchos::Time > timerSolve_
PCPGSolMgrLinearProblemFailure is thrown when the linear problem is not setup (i.e.
static const double convTol
Default convergence tolerance.
Teuchos::RCP< LinearProblem< ScalarType, MV, OP > > problem_
Belos::StatusTest class for specifying a maximum number of iterations.
Teuchos::RCP< std::ostream > outputStream_
static std::string name()
A factory class for generating StatusTestOutput objects.
Traits class which defines basic operations on multivectors.
Belos::StatusTest for logically combining several status tests.
Teuchos::RCP< const Teuchos::SerialDenseMatrix< int, ScalarType > > D
The current Hessenberg matrix.
bool isParameter(const std::string &name) const
Teuchos::RCP< const Teuchos::ParameterList > getCurrentParameters() const
Get a parameter list containing the current parameters for this object.
OperatorTraits< ScalarType, MV, OP > OPT
A Belos::StatusTest class for specifying a maximum number of iterations.
MagnitudeType achievedTol() const
Tolerance achieved by the last solve() invocation.
ResetType
How to reset the solver.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Pure virtual base class which describes the basic interface for a solver manager. ...
MagnitudeType convtol_
Convergence tolerance (read from parameter list).
void reset(const ResetType type)
Performs a reset of the solver manager specified by the ResetType. This informs the solver manager th...
Teuchos::RCP< StatusTest< ScalarType, MV, OP > > sTest_
static void summarize(Ptr< const Comm< int > > comm, std::ostream &out=std::cout, const bool alwaysWriteLocal=false, const bool writeGlobalStats=true, const bool writeZeroTimers=true, const ECounterSetOp setOp=Intersection, const std::string &filter="", const bool ignoreZeroTimers=false)
bool is_null(const RCP< T > &p)
MagnitudeType achievedTol_
Tolerance achieved by the last solve() invocation.
A linear system to solve, and its associated information.
MultiVecTraits< ScalarType, MV > MVT
void setProblem(const Teuchos::RCP< LinearProblem< ScalarType, MV, OP > > &problem)
Set the linear problem that needs to be solved.
Class which describes the linear problem to be solved by the iterative solver.
PCPGSolMgrLAPACKFailure is thrown when a nonzero value is retuned from an LAPACK call.
virtual Teuchos::RCP< SolverManager< ScalarType, MV, OP > > clone() const
clone for Inverted Injection (DII)
PCPGSolMgrLAPACKFailure(const std::string &what_arg)
int getNumIters() const
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...
ReturnType
Whether the Belos solve converged for all linear systems.
void validateParameters(ParameterList const &validParamList, int const depth=1000, EValidateUsed const validateUsed=VALIDATE_USED_ENABLED, EValidateDefaults const validateDefaults=VALIDATE_DEFAULTS_ENABLED) const
Teuchos::RCP< OutputManager< ScalarType > > printer_
Teuchos::RCP< MV > U
The recycled subspace.
Teuchos::Array< Teuchos::RCP< Teuchos::Time > > getTimers() const
Return the timers for this object.
OrdinalType numCols() const
Teuchos::ScalarTraits< ScalarType >::magnitudeType MagnitudeType
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.
PCPGIterOrthoFailure is thrown when the PCPGIter object is unable to compute independent direction ve...
void GESVD(const char &JOBU, const char &JOBVT, const OrdinalType &m, const OrdinalType &n, ScalarType *A, const OrdinalType &lda, MagnitudeType *S, ScalarType *U, const OrdinalType &ldu, ScalarType *V, const OrdinalType &ldv, ScalarType *WORK, const OrdinalType &lwork, MagnitudeType *RWORK, OrdinalType *info) const
Teuchos::ScalarTraits< ScalarType > SCT
Belos::StatusTestResNorm for specifying general residual norm stopping criteria.
PCPG iterative linear solver.
bool isType(const std::string &name) const
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.
Teuchos::RCP< StatusTestGenResNorm< ScalarType, MV, OP > > convTest_
Teuchos::RCP< StatusTestMaxIters< ScalarType, MV, OP > > maxIterTest_
virtual ~PCPGSolMgr()
Destructor.
Class which defines basic traits for the operator type.
Parent class to all Belos exceptions.
Default parameters common to most Belos solvers.
Teuchos::RCP< MatOrthoManager< ScalarType, MV, OP > > ortho_
Details::SolverManagerRequiresRealLapack< ScalarType, MV, OP, scalarTypeIsSupported > base_type
Teuchos::RCP< SolverManager< ScalarType, MV, OP > > clone() const override
clone for Inverted Injection (DII)
PCPGSolMgrRecyclingFailure(const std::string &what_arg)
This class implements the PCPG iteration, where a single-std::vector Krylov subspace is constructed...
Belos header file which uses auto-configuration information to include necessary C++ headers...
Teuchos::RCP< Teuchos::ParameterList > params_
PCPGSolMgrLinearProblemFailure(const std::string &what_arg)
OrdinalType numRows() const
Teuchos::ScalarTraits< MagnitudeType > MT
Teuchos::RCP< Belos::MatOrthoManager< Scalar, MV, OP > > makeMatOrthoManager(const std::string &ortho, const Teuchos::RCP< const OP > &M, const Teuchos::RCP< OutputManager< Scalar > > &, const std::string &label, const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
Return an instance of the specified MatOrthoManager subclass.