42 #ifndef BELOS_PCPG_SOLMGR_HPP
43 #define BELOS_PCPG_SOLMGR_HPP
63 #ifdef BELOS_TEUCHOS_TIME_MONITOR
66 #if defined(HAVE_TEUCHOSCORE_CXX11)
67 # include <type_traits>
68 #endif // defined(HAVE_TEUCHOSCORE_CXX11)
137 template<
class ScalarType,
class MV,
class OP,
138 const bool supportsScalarType =
143 Belos::Details::LapackSupportsScalar<ScalarType>::value &&
144 ! Teuchos::ScalarTraits<ScalarType>::isComplex>
146 static const bool scalarTypeIsSupported =
168 template<
class ScalarType,
class MV,
class OP>
260 return Teuchos::tuple(timerSolve_);
331 std::string description()
const;
361 static constexpr
int maxIters_default_ = 1000;
362 static constexpr
int deflatedBlocks_default_ = 2;
363 static constexpr
int savedBlocks_default_ = 16;
366 static constexpr
int outputFreq_default_ = -1;
367 static constexpr
const char * label_default_ =
"Belos";
368 static constexpr
const char * orthoType_default_ =
"ICGS";
375 MagnitudeType convtol_;
378 MagnitudeType orthoKappa_;
381 MagnitudeType achievedTol_;
389 int deflatedBlocks_, savedBlocks_, verbosity_, outputStyle_, outputFreq_;
390 std::string orthoType_;
408 template<
class ScalarType,
class MV,
class OP>
410 outputStream_(Teuchos::rcpFromRef(std::cout)),
413 achievedTol_(Teuchos::ScalarTraits<MagnitudeType>::zero()),
415 maxIters_(maxIters_default_),
416 deflatedBlocks_(deflatedBlocks_default_),
417 savedBlocks_(savedBlocks_default_),
418 verbosity_(verbosity_default_),
419 outputStyle_(outputStyle_default_),
420 outputFreq_(outputFreq_default_),
421 orthoType_(orthoType_default_),
423 label_(label_default_),
429 template<
class ScalarType,
class MV,
class OP>
434 outputStream_(Teuchos::rcpFromRef(std::cout)),
438 achievedTol_(Teuchos::ScalarTraits<MagnitudeType>::zero()),
440 maxIters_(maxIters_default_),
441 deflatedBlocks_(deflatedBlocks_default_),
442 savedBlocks_(savedBlocks_default_),
443 verbosity_(verbosity_default_),
444 outputStyle_(outputStyle_default_),
445 outputFreq_(outputFreq_default_),
446 orthoType_(orthoType_default_),
448 label_(label_default_),
452 problem_.is_null (), std::invalid_argument,
453 "Belos::PCPGSolMgr two-argument constructor: "
454 "'problem' is null. You must supply a non-null Belos::LinearProblem "
455 "instance when calling this constructor.");
464 template<
class ScalarType,
class MV,
class OP>
468 if (params_ == Teuchos::null) {
477 maxIters_ = params->
get(
"Maximum Iterations",maxIters_default_);
480 params_->set(
"Maximum Iterations", maxIters_);
481 if (maxIterTest_!=Teuchos::null)
482 maxIterTest_->setMaxIters( maxIters_ );
487 savedBlocks_ = params->
get(
"Num Saved Blocks",savedBlocks_default_);
489 "Belos::PCPGSolMgr: \"Num Saved Blocks\" must be strictly positive.");
496 params_->set(
"Num Saved Blocks", savedBlocks_);
499 deflatedBlocks_ = params->
get(
"Num Deflated Blocks",deflatedBlocks_default_);
501 "Belos::PCPGSolMgr: \"Num Deflated Blocks\" must be positive.");
504 "Belos::PCPGSolMgr: \"Num Deflated Blocks\" must be <= \"Num Saved Blocks\".");
508 params_->set(
"Num Deflated Blocks", static_cast<int>(deflatedBlocks_));
513 std::string tempLabel = params->
get(
"Timer Label", label_default_);
516 if (tempLabel != label_) {
518 params_->set(
"Timer Label", label_);
519 std::string solveLabel = label_ +
": PCPGSolMgr total solve time";
520 #ifdef BELOS_TEUCHOS_TIME_MONITOR
523 if (ortho_ != Teuchos::null) {
524 ortho_->setLabel( label_ );
531 if (Teuchos::isParameterType<int>(*params,
"Verbosity")) {
532 verbosity_ = params->
get(
"Verbosity", verbosity_default_);
534 verbosity_ = (int)Teuchos::getParameter<Belos::MsgType>(*params,
"Verbosity");
538 params_->set(
"Verbosity", verbosity_);
539 if (printer_ != Teuchos::null)
540 printer_->setVerbosity(verbosity_);
545 if (Teuchos::isParameterType<int>(*params,
"Output Style")) {
546 outputStyle_ = params->
get(
"Output Style", outputStyle_default_);
548 outputStyle_ = (int)Teuchos::getParameter<Belos::OutputType>(*params,
"Output Style");
552 params_->set(
"Output Style", outputStyle_);
553 outputTest_ = Teuchos::null;
558 outputStream_ = Teuchos::getParameter<Teuchos::RCP<std::ostream> >(*params,
"Output Stream");
561 params_->set(
"Output Stream", outputStream_);
562 if (printer_ != Teuchos::null)
563 printer_->setOStream( outputStream_ );
569 outputFreq_ = params->
get(
"Output Frequency", outputFreq_default_);
573 params_->set(
"Output Frequency", outputFreq_);
574 if (outputTest_ != Teuchos::null)
575 outputTest_->setOutputFrequency( outputFreq_ );
579 if (printer_ == Teuchos::null) {
584 bool changedOrthoType =
false;
586 std::string tempOrthoType = params->
get(
"Orthogonalization",orthoType_default_);
587 if (tempOrthoType != orthoType_) {
588 orthoType_ = tempOrthoType;
589 changedOrthoType =
true;
592 params_->set(
"Orthogonalization", orthoType_);
595 if (params->
isParameter(
"Orthogonalization Constant")) {
596 if (params->
isType<MagnitudeType> (
"Orthogonalization Constant")) {
597 orthoKappa_ = params->
get (
"Orthogonalization Constant",
601 orthoKappa_ = params->
get (
"Orthogonalization Constant",
606 params_->set(
"Orthogonalization Constant",orthoKappa_);
607 if (orthoType_==
"DGKS") {
608 if (orthoKappa_ > 0 && ortho_ != Teuchos::null && !changedOrthoType) {
615 if (ortho_ == Teuchos::null || changedOrthoType) {
618 if (orthoType_==
"DGKS" && orthoKappa_ > 0) {
619 paramsOrtho->
set (
"depTol", orthoKappa_ );
622 ortho_ = factory.
makeMatOrthoManager (orthoType_, Teuchos::null, printer_, label_, paramsOrtho);
630 if (params->
isParameter(
"Convergence Tolerance")) {
631 if (params->
isType<MagnitudeType> (
"Convergence Tolerance")) {
632 convtol_ = params->
get (
"Convergence Tolerance",
640 params_->set(
"Convergence Tolerance", convtol_);
641 if (convTest_ != Teuchos::null)
642 convTest_->setTolerance( convtol_ );
648 if (maxIterTest_ == Teuchos::null)
651 if (convTest_ == Teuchos::null)
652 convTest_ =
Teuchos::rcp(
new StatusTestResNorm_t( convtol_, 1 ) );
654 sTest_ =
Teuchos::rcp(
new StatusTestCombo_t( StatusTestCombo_t::OR, maxIterTest_, convTest_ ) );
662 std::string solverDesc =
" PCPG ";
663 outputTest_->setSolverDesc( solverDesc );
666 if (timerSolve_ == Teuchos::null) {
667 std::string solveLabel = label_ +
": PCPGSolMgr total solve time";
668 #ifdef BELOS_TEUCHOS_TIME_MONITOR
678 template<
class ScalarType,
class MV,
class OP>
687 "The relative residual tolerance that needs to be achieved by the\n"
688 "iterative solver in order for the linear system to be declared converged.");
689 pl->
set(
"Maximum Iterations", static_cast<int>(maxIters_default_),
690 "The maximum number of iterations allowed for each\n"
691 "set of RHS solved.");
692 pl->
set(
"Num Deflated Blocks", static_cast<int>(deflatedBlocks_default_),
693 "The maximum number of vectors in the seed subspace." );
694 pl->
set(
"Num Saved Blocks", static_cast<int>(savedBlocks_default_),
695 "The maximum number of vectors saved from old Krylov subspaces." );
696 pl->
set(
"Verbosity", static_cast<int>(verbosity_default_),
697 "What type(s) of solver information should be outputted\n"
698 "to the output stream.");
699 pl->
set(
"Output Style", static_cast<int>(outputStyle_default_),
700 "What style is used for the solver information outputted\n"
701 "to the output stream.");
702 pl->
set(
"Output Frequency", static_cast<int>(outputFreq_default_),
703 "How often convergence information should be outputted\n"
704 "to the output stream.");
705 pl->
set(
"Output Stream", Teuchos::rcpFromRef(std::cout),
706 "A reference-counted pointer to the output stream where all\n"
707 "solver output is sent.");
708 pl->
set(
"Timer Label", static_cast<const char *>(label_default_),
709 "The string to use as a prefix for the timer labels.");
710 pl->
set(
"Orthogonalization", static_cast<const char *>(orthoType_default_),
711 "The type of orthogonalization to use: DGKS, ICGS, IMGS");
713 "The constant used by DGKS orthogonalization to determine\n"
714 "whether another step of classical Gram-Schmidt is necessary.");
722 template<
class ScalarType,
class MV,
class OP>
726 if (!isSet_) { setParameters( params_ ); }
733 "Belos::PCPGSolMgr::solve(): Linear problem is not a valid object.");
736 "Belos::PCPGSolMgr::solve(): Linear problem is not ready, setProblem() has not been called.");
739 int numRHS2Solve = MVT::GetNumberVecs( *(problem_->getRHS()) );
740 std::vector<int> currIdx(1);
746 problem_->setLSIndex( currIdx );
749 bool isConverged =
true;
754 plist.
set(
"Saved Blocks", savedBlocks_);
755 plist.
set(
"Block Size", 1);
756 plist.
set(
"Keep Diagonal",
true);
757 plist.
set(
"Initialize Diagonal",
true);
768 #ifdef BELOS_TEUCHOS_TIME_MONITOR
771 while ( numRHS2Solve > 0 ) {
774 outputTest_->reset();
777 if (R_ == Teuchos::null)
778 R_ = MVT::Clone( *(problem_->getRHS()), 1 );
780 problem_->computeCurrResVec( &*R_ );
786 if( U_ != Teuchos::null ){
792 std::vector<MagnitudeType> rnorm0(1);
793 MVT::MvNorm( *R_, rnorm0 );
796 std::cout <<
"Solver Manager: dimU_ = " << dimU_ << std::endl;
800 std::vector<int> active_columns( dimU_ );
801 for (
int i=0; i < dimU_; ++i) active_columns[i] = i;
802 Uactive = MVT::CloneView(*U_, active_columns);
803 Cactive = MVT::CloneView(*C_, active_columns);
806 std::cout <<
" Solver Manager : check duality of seed basis " << std::endl;
808 MVT::MvTransMv( one, *Uactive, *Cactive, H );
809 H.
print( std::cout );
812 MVT::MvTransMv( one, *Uactive, *R_, Z );
814 MVT::MvTimesMatAddMv( one, *Uactive, Z, zero, *tempU );
815 MVT::MvAddMv( one, *tempU, one, *cur_soln_vec, *cur_soln_vec );
816 MVT::MvTimesMatAddMv( one, *Cactive, Z, zero, *tempU );
817 MVT::MvAddMv( -one, *tempU, one, *R_, *R_ );
818 std::vector<MagnitudeType> rnorm(1);
819 MVT::MvNorm( *R_, rnorm );
820 if( rnorm[0] < rnorm0[0] * .001 ){
821 MVT::MvTransMv( one, *Uactive, *R_, Z );
822 MVT::MvTimesMatAddMv( one, *Uactive, Z, zero, *tempU );
823 MVT::MvAddMv( one, *tempU, one, *cur_soln_vec, *cur_soln_vec );
824 MVT::MvTimesMatAddMv( one, *Cactive, Z, zero, *tempU );
825 MVT::MvAddMv( -one, *tempU, one, *R_, *R_ );
827 Uactive = Teuchos::null;
828 Cactive = Teuchos::null;
829 tempU = Teuchos::null;
840 if( U_ != Teuchos::null ) pcpgState.
U = U_;
841 if( C_ != Teuchos::null ) pcpgState.
C = C_;
842 if( dimU_ > 0 ) pcpgState.
curDim = dimU_;
843 pcpg_iter->initialize(pcpgState);
849 if( !dimU_ ) printer_->stream(
Debug) <<
" No recycled subspace available for RHS index " << currIdx[0] << std::endl << std::endl;
850 pcpg_iter->resetNumIters();
852 if( dimU_ > savedBlocks_ )
853 std::cout <<
"Error: dimU_ = " << dimU_ <<
" > savedBlocks_ = " << savedBlocks_ << std::endl;
859 if( debug ) printf(
"********** Calling iterate...\n");
860 pcpg_iter->iterate();
867 if ( convTest_->getStatus() ==
Passed ) {
876 else if ( maxIterTest_->getStatus() ==
Passed ) {
891 "Belos::PCPGSolMgr::solve(): Invalid return from PCPGIter::iterate().");
896 achievedTol_ = MT::one();
898 MVT::MvInit( *X, SCT::zero() );
899 printer_->stream(
Warnings) <<
"Belos::PCPG::solve(): Warning! NaN has been detected!"
903 catch (
const std::exception &e) {
904 printer_->stream(
Errors) <<
"Error! Caught exception in PCPGIter::iterate() at iteration "
905 << pcpg_iter->getNumIters() << std::endl
906 << e.what() << std::endl;
913 problem_->updateSolution( update,
true );
916 problem_->setCurrLS();
924 std::cout <<
"SolverManager: dimU_ " << dimU_ <<
" prevUdim= " << q << std::endl;
926 if( q > deflatedBlocks_ )
927 std::cout <<
"SolverManager: Error deflatedBlocks = " << deflatedBlocks_ << std::endl;
938 rank = ARRQR(dimU_,q, *oldState.
D );
940 std::cout <<
" rank decreased in ARRQR, something to do? " << std::endl;
946 if( dimU_ > deflatedBlocks_ ){
948 if( !deflatedBlocks_ ){
951 dimU_ = deflatedBlocks_;
955 bool Harmonic =
false;
959 std::vector<int> active_cols( dimU_ );
960 for (
int i=0; i < dimU_; ++i) active_cols[i] = i;
963 Uorth = MVT::CloneCopy(*C_, active_cols);
966 Uorth = MVT::CloneCopy(*U_, active_cols);
971 rank = ortho_->normalize(*Uorth,
Teuchos::rcp(&R,
false));
972 Uorth = Teuchos::null;
978 "Belos::PCPGSolMgr::solve(): Failed to compute orthonormal basis for initial recycled subspace.");
987 if( problem_->isHermitian() ) lrwork = dimU_;
988 std::vector<ScalarType> work(lwork);
989 std::vector<ScalarType> Svec(dimU_);
990 std::vector<ScalarType> rwork(lrwork);
991 lapack.
GESVD(
'N',
'O',
1000 "Belos::PCPGSolMgr::solve(): LAPACK _GESVD failed to compute singular values.");
1002 if( work[0] != 67. * dimU_ )
1003 std::cout <<
" SVD " << dimU_ <<
" lwork " << work[0] << std::endl;
1004 for(
int i=0; i< dimU_; i++)
1005 std::cout << i <<
" " << Svec[i] << std::endl;
1009 int startRow = 0, startCol = 0;
1011 startCol = dimU_ - deflatedBlocks_;
1019 std::vector<int> active_columns( dimU_ );
1020 std::vector<int> def_cols( deflatedBlocks_ );
1021 for (
int i=0; i < dimU_; ++i) active_columns[i] = i;
1022 for (
int i=0; i < deflatedBlocks_; ++i) def_cols[i] = i;
1026 MVT::MvTimesMatAddMv( one, *Ucopy, V, zero, *Uactive );
1027 Ucopy = Teuchos::null;
1028 Uactive = Teuchos::null;
1031 MVT::MvTimesMatAddMv( one, *Ccopy, V, zero, *Cactive );
1032 Ccopy = Teuchos::null;
1033 Cactive = Teuchos::null;
1034 dimU_ = deflatedBlocks_;
1036 printer_->stream(
Debug) <<
" Generated recycled subspace using RHS index " << currIdx[0] <<
" of dimension " << dimU_ << std::endl << std::endl;
1039 problem_->setCurrLS();
1043 if ( numRHS2Solve > 0 ) {
1047 problem_->setLSIndex( currIdx );
1050 currIdx.resize( numRHS2Solve );
1059 #ifdef BELOS_TEUCHOS_TIME_MONITOR
1069 using Teuchos::rcp_dynamic_cast;
1072 const std::vector<MagnitudeType>* pTestValues =
1073 rcp_dynamic_cast<conv_test_type>(convTest_)->getTestValue();
1076 "Belos::PCPGSolMgr::solve(): The convergence test's getTestValue() "
1077 "method returned NULL. Please report this bug to the Belos developers.");
1080 "Belos::PCPGSolMgr::solve(): The convergence test's getTestValue() "
1081 "method returned a vector of length zero. Please report this bug to the "
1082 "Belos developers.");
1087 achievedTol_ = *std::max_element (pTestValues->begin(), pTestValues->end());
1091 numIters_ = maxIterTest_->getNumIters();
1102 template<
class ScalarType,
class MV,
class OP>
1113 std::vector<int> curind(1);
1114 std::vector<int> ipiv(p - q);
1115 std::vector<ScalarType> Pivots(p);
1117 ScalarType rteps = 1.5e-8;
1120 for( i = q ; i < p ; i++ ){
1123 RCP<MV> P = MVT::CloneViewNonConst(*U_,curind);
1124 RCP<MV> AP = MVT::CloneViewNonConst(*C_,curind);
1126 MVT::MvAddMv( anorm(0,0), *P, zero, *AP, *P );
1127 MVT::MvAddMv( zero, *P, anorm(0,0), *AP, *AP );
1131 for( i = q ; i < p ; i++ ){
1132 if( q < i && i < p-1 ){
1135 for( j = i+1 ; j < p ; j++ ){
1136 const int k = ipiv[j-q];
1137 if( Pivots[k] > Pivots[l] ){
1144 ipiv[imax-q] = ipiv[i-q];
1150 if( Pivots[k] > 1.5625e-2 ){
1151 anorm(0,0) = Pivots[k];
1155 RCP<const MV> P = MVT::CloneView(*U_,curind);
1156 RCP<const MV> AP = MVT::CloneView(*C_,curind);
1157 MVT::MvTransMv( one, *P, *AP, anorm );
1160 if( rteps <= anorm(0,0) && anorm(0,0) < 9.765625e-4){
1168 std::cout <<
"ARRQR: Bad case not implemented" << std::endl;
1170 if( anorm(0,0) < rteps ){
1171 std::cout <<
"ARRQR : deficient case not implemented " << std::endl;
1179 RCP<MV> P = MVT::CloneViewNonConst(*U_,curind);
1180 RCP<MV> AP = MVT::CloneViewNonConst(*C_,curind);
1181 MVT::MvAddMv( anorm(0,0), *P, zero, *AP, *P );
1182 MVT::MvAddMv( zero, *P, anorm(0,0), *AP, *AP );
1186 P = MVT::CloneViewNonConst(*U_,curind);
1187 AP = MVT::CloneViewNonConst(*C_,curind);
1188 for( j = i+1 ; j < p ; j++ ){
1191 RCP<MV> Q = MVT::CloneViewNonConst(*U_,curind);
1192 MVT::MvTransMv( one, *Q, *AP, alpha);
1193 MVT::MvAddMv( -alpha(0,0), *P, one, *Q, *Q );
1195 RCP<MV> AQ = MVT::CloneViewNonConst(*C_,curind);
1196 MVT::MvAddMv( -alpha(0,0), *AP, one, *AQ, *AQ );
1198 gamma(0,0) = ( Pivots[l] - alpha(0,0))*( Pivots[l] + alpha(0,0));
1199 if( gamma(0,0) > 0){
1211 template<
class ScalarType,
class MV,
class OP>
1214 std::ostringstream oss;
1217 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.
bool is_null(const boost::shared_ptr< T > &p)
Belos concrete class to iterate Preconditioned Conjugate Projected Gradients.
PCPGSolMgrOrthoFailure is thrown when the orthogonalization manager is unable to generate orthonormal...
Teuchos::RCP< MV > R
The current residual.
T & get(const std::string &name, T def_value)
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...
#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)
const LinearProblem< ScalarType, MV, OP > & getProblem() const
Get current linear problem being solved for in this object.
Structure to contain pointers to PCPGIter state variables.
PCPGSolMgrLinearProblemFailure is thrown when the linear problem is not setup (i.e.
static const double convTol
Default convergence tolerance.
Belos::StatusTest class for specifying a maximum number of iterations.
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.
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. ...
void reset(const ResetType type)
Performs a reset of the solver manager specified by the ResetType. This informs the solver manager th...
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)
A linear system to solve, and its associated information.
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< MV > U
The recycled subspace.
Teuchos::Array< Teuchos::RCP< Teuchos::Time > > getTimers() const
Return the timers for this object.
OrdinalType numCols() const
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.
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
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.
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< SolverManager< ScalarType, MV, OP > > clone() const override
clone for Inverted Injection (DII)
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...
PCPGSolMgrLinearProblemFailure(const std::string &what_arg)
OrdinalType numRows() const
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.