42 #ifndef BELOS_PCPG_SOLMGR_HPP
43 #define BELOS_PCPG_SOLMGR_HPP
67 #ifdef BELOS_TEUCHOS_TIME_MONITOR
138 template<
class ScalarType,
class MV,
class OP>
226 return Teuchos::tuple(timerSolve_);
327 static const MagnitudeType convtol_default_;
328 static const MagnitudeType orthoKappa_default_;
329 static const int maxIters_default_;
330 static const int deflatedBlocks_default_;
331 static const int savedBlocks_default_;
332 static const int verbosity_default_;
333 static const int outputStyle_default_;
334 static const int outputFreq_default_;
335 static const std::string label_default_;
336 static const std::string orthoType_default_;
344 MagnitudeType convtol_;
347 MagnitudeType orthoKappa_;
350 MagnitudeType achievedTol_;
358 int deflatedBlocks_, savedBlocks_, verbosity_, outputStyle_, outputFreq_;
359 std::string orthoType_;
377 template<
class ScalarType,
class MV,
class OP>
378 const typename PCPGSolMgr<ScalarType,MV,OP>::MagnitudeType PCPGSolMgr<ScalarType,MV,OP>::convtol_default_ = 1e-8;
380 template<
class ScalarType,
class MV,
class OP>
381 const typename PCPGSolMgr<ScalarType,MV,OP>::MagnitudeType PCPGSolMgr<ScalarType,MV,OP>::orthoKappa_default_ = -1.0;
383 template<
class ScalarType,
class MV,
class OP>
384 const int PCPGSolMgr<ScalarType,MV,OP>::maxIters_default_ = 1000;
386 template<
class ScalarType,
class MV,
class OP>
387 const int PCPGSolMgr<ScalarType,MV,OP>::deflatedBlocks_default_ = 2;
389 template<
class ScalarType,
class MV,
class OP>
390 const int PCPGSolMgr<ScalarType,MV,OP>::savedBlocks_default_ = 16;
392 template<
class ScalarType,
class MV,
class OP>
393 const int PCPGSolMgr<ScalarType,MV,OP>::verbosity_default_ =
Belos::Errors;
395 template<
class ScalarType,
class MV,
class OP>
396 const int PCPGSolMgr<ScalarType,MV,OP>::outputStyle_default_ =
Belos::General;
398 template<
class ScalarType,
class MV,
class OP>
399 const int PCPGSolMgr<ScalarType,MV,OP>::outputFreq_default_ = -1;
401 template<
class ScalarType,
class MV,
class OP>
402 const std::string PCPGSolMgr<ScalarType,MV,OP>::label_default_ =
"Belos";
404 template<
class ScalarType,
class MV,
class OP>
405 const std::string PCPGSolMgr<ScalarType,MV,OP>::orthoType_default_ =
"DGKS";
407 template<
class ScalarType,
class MV,
class OP>
412 template<
class ScalarType,
class MV,
class OP>
414 outputStream_(outputStream_default_),
415 convtol_(convtol_default_),
416 orthoKappa_(orthoKappa_default_),
417 achievedTol_(Teuchos::ScalarTraits<MagnitudeType>::zero()),
419 maxIters_(maxIters_default_),
420 deflatedBlocks_(deflatedBlocks_default_),
421 savedBlocks_(savedBlocks_default_),
422 verbosity_(verbosity_default_),
423 outputStyle_(outputStyle_default_),
424 outputFreq_(outputFreq_default_),
425 orthoType_(orthoType_default_),
426 label_(label_default_),
432 template<
class ScalarType,
class MV,
class OP>
437 outputStream_(outputStream_default_),
438 convtol_(convtol_default_),
439 orthoKappa_(orthoKappa_default_),
440 achievedTol_(Teuchos::ScalarTraits<MagnitudeType>::zero()),
442 maxIters_(maxIters_default_),
443 deflatedBlocks_(deflatedBlocks_default_),
444 savedBlocks_(savedBlocks_default_),
445 verbosity_(verbosity_default_),
446 outputStyle_(outputStyle_default_),
447 outputFreq_(outputFreq_default_),
448 orthoType_(orthoType_default_),
449 label_(label_default_),
461 template<
class ScalarType,
class MV,
class OP>
465 if (params_ == Teuchos::null) {
474 maxIters_ = params->
get(
"Maximum Iterations",maxIters_default_);
477 params_->set(
"Maximum Iterations", maxIters_);
478 if (maxIterTest_!=Teuchos::null)
479 maxIterTest_->setMaxIters( maxIters_ );
484 savedBlocks_ = params->
get(
"Num Saved Blocks",savedBlocks_default_);
486 "Belos::PCPGSolMgr: \"Num Saved Blocks\" must be strictly positive.");
493 params_->set(
"Num Saved Blocks", savedBlocks_);
496 deflatedBlocks_ = params->
get(
"Num Deflated Blocks",deflatedBlocks_default_);
498 "Belos::PCPGSolMgr: \"Num Deflated Blocks\" must be positive.");
501 "Belos::PCPGSolMgr: \"Num Deflated Blocks\" must be <= \"Num Saved Blocks\".");
504 params_->set(
"Num Deflated Blocks", deflatedBlocks_);
509 std::string tempLabel = params->
get(
"Timer Label", label_default_);
512 if (tempLabel != label_) {
514 params_->set(
"Timer Label", label_);
515 std::string solveLabel = label_ +
": PCPGSolMgr total solve time";
516 #ifdef BELOS_TEUCHOS_TIME_MONITOR
519 if (ortho_ != Teuchos::null) {
520 ortho_->setLabel( label_ );
527 std::string tempOrthoType = params->
get(
"Orthogonalization",orthoType_default_);
529 std::invalid_argument,
530 "Belos::PCPGSolMgr: \"Orthogonalization\" must be either \"DGKS\", \"ICGS\", or \"IMGS\".");
531 if (tempOrthoType != orthoType_) {
532 orthoType_ = tempOrthoType;
534 if (orthoType_==
"DGKS") {
535 if (orthoKappa_ <= 0) {
543 else if (orthoType_==
"ICGS") {
546 else if (orthoType_==
"IMGS") {
553 if (params->
isParameter(
"Orthogonalization Constant")) {
554 orthoKappa_ = params->
get(
"Orthogonalization Constant",orthoKappa_default_);
557 params_->set(
"Orthogonalization Constant",orthoKappa_);
558 if (orthoType_==
"DGKS") {
559 if (orthoKappa_ > 0 && ortho_ != Teuchos::null) {
567 if (Teuchos::isParameterType<int>(*params,
"Verbosity")) {
568 verbosity_ = params->
get(
"Verbosity", verbosity_default_);
570 verbosity_ = (int)Teuchos::getParameter<Belos::MsgType>(*params,
"Verbosity");
574 params_->set(
"Verbosity", verbosity_);
575 if (printer_ != Teuchos::null)
576 printer_->setVerbosity(verbosity_);
581 if (Teuchos::isParameterType<int>(*params,
"Output Style")) {
582 outputStyle_ = params->
get(
"Output Style", outputStyle_default_);
584 outputStyle_ = (int)Teuchos::getParameter<Belos::OutputType>(*params,
"Output Style");
588 params_->set(
"Output Style", outputStyle_);
589 outputTest_ = Teuchos::null;
594 outputStream_ = Teuchos::getParameter<Teuchos::RCP<std::ostream> >(*params,
"Output Stream");
597 params_->set(
"Output Stream", outputStream_);
598 if (printer_ != Teuchos::null)
599 printer_->setOStream( outputStream_ );
605 outputFreq_ = params->
get(
"Output Frequency", outputFreq_default_);
609 params_->set(
"Output Frequency", outputFreq_);
610 if (outputTest_ != Teuchos::null)
611 outputTest_->setOutputFrequency( outputFreq_ );
615 if (printer_ == Teuchos::null) {
624 if (params->
isParameter(
"Convergence Tolerance")) {
625 convtol_ = params->
get(
"Convergence Tolerance",convtol_default_);
628 params_->set(
"Convergence Tolerance", convtol_);
629 if (convTest_ != Teuchos::null)
630 convTest_->setTolerance( convtol_ );
636 if (maxIterTest_ == Teuchos::null)
639 if (convTest_ == Teuchos::null)
640 convTest_ =
Teuchos::rcp(
new StatusTestResNorm_t( convtol_, 1 ) );
642 sTest_ =
Teuchos::rcp(
new StatusTestCombo_t( StatusTestCombo_t::OR, maxIterTest_, convTest_ ) );
650 std::string solverDesc =
" PCPG ";
651 outputTest_->setSolverDesc( solverDesc );
655 if (ortho_ == Teuchos::null) {
656 if (orthoType_==
"DGKS") {
657 if (orthoKappa_ <= 0) {
665 else if (orthoType_==
"ICGS") {
668 else if (orthoType_==
"IMGS") {
673 "Belos::PCPGSolMgr(): Invalid orthogonalization type.");
678 if (timerSolve_ == Teuchos::null) {
679 std::string solveLabel = label_ +
": PCPGSolMgr total solve time";
680 #ifdef BELOS_TEUCHOS_TIME_MONITOR
690 template<
class ScalarType,
class MV,
class OP>
698 pl->
set(
"Convergence Tolerance", convtol_default_,
699 "The relative residual tolerance that needs to be achieved by the\n"
700 "iterative solver in order for the linear system to be declared converged.");
701 pl->
set(
"Maximum Iterations", maxIters_default_,
702 "The maximum number of iterations allowed for each\n"
703 "set of RHS solved.");
704 pl->
set(
"Num Deflated Blocks", deflatedBlocks_default_,
705 "The maximum number of vectors in the seed subspace." );
706 pl->
set(
"Num Saved Blocks", savedBlocks_default_,
707 "The maximum number of vectors saved from old Krylov subspaces." );
708 pl->
set(
"Verbosity", verbosity_default_,
709 "What type(s) of solver information should be outputted\n"
710 "to the output stream.");
711 pl->
set(
"Output Style", outputStyle_default_,
712 "What style is used for the solver information outputted\n"
713 "to the output stream.");
714 pl->
set(
"Output Frequency", outputFreq_default_,
715 "How often convergence information should be outputted\n"
716 "to the output stream.");
717 pl->
set(
"Output Stream", outputStream_default_,
718 "A reference-counted pointer to the output stream where all\n"
719 "solver output is sent.");
720 pl->
set(
"Timer Label", label_default_,
721 "The string to use as a prefix for the timer labels.");
723 pl->
set(
"Orthogonalization", orthoType_default_,
724 "The type of orthogonalization to use: DGKS, ICGS, IMGS");
725 pl->
set(
"Orthogonalization Constant",orthoKappa_default_,
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();
791 if (R_ == Teuchos::null)
792 R_ = MVT::Clone( *(problem_->getRHS()), 1 );
794 problem_->computeCurrResVec( &*R_ );
800 if( U_ != Teuchos::null ){
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_ );
841 Uactive = Teuchos::null;
842 Cactive = Teuchos::null;
843 tempU = Teuchos::null;
854 if( U_ != Teuchos::null ) pcpgState.
U = U_;
855 if( C_ != Teuchos::null ) pcpgState.
C = C_;
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));
985 Uorth = Teuchos::null;
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 );
1040 Ucopy = Teuchos::null;
1041 Uactive = Teuchos::null;
1044 MVT::MvTimesMatAddMv( one, *Ccopy, V, zero, *Cactive );
1045 Ccopy = Teuchos::null;
1046 Cactive = Teuchos::null;
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);
1129 int i, imax, j, k, l;
1130 ScalarType rteps = 1.5e-8;
1133 for(
int 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++ ){
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_;
ScalarType * values() const
Collection of types and exceptions used within the Belos solvers.
Teuchos::RCP< const Teuchos::ParameterList > getCurrentParameters() const
Get a parameter list containing the current parameters for this object.
int prevUdim
Number of block columns in matrices C and U before current iteration.
virtual ~PCPGSolMgr()
Destructor.
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.
ReturnType solve()
The method either solves the problem or decides to quit. On each call, a (possibly null) seed space i...
bool is_null(const boost::shared_ptr< T > &p)
virtual void print(std::ostream &os) const
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)
Teuchos::RCP< MV > C
C = AU, U spans recycled subspace.
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.
int curDim
The current dimension of the reduction.
An implementation of StatusTestResNorm using a family of residual norms.
PCPGSolMgrOrthoFailure(const std::string &what_arg)
Structure to contain pointers to PCPGIter state variables.
PCPGSolMgrLinearProblemFailure is thrown when the linear problem is not setup (i.e.
const LinearProblem< ScalarType, MV, OP > & getProblem() const
Get current linear problem being solved for in this object.
Belos::StatusTest class for specifying a maximum number of iterations.
static std::string name()
A factory class for generating StatusTestOutput objects.
Iterated Modified Gram-Schmidt (IMGS) implementation of the Belos::OrthoManager class.
std::string description() const
Method to return description of the PCPG solver manager.
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
Get a parameter list containing the valid parameters for this object.
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="")
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
void reset(const ResetType type)
Performs a reset of the solver manager specified by the ResetType. This informs the solver manager th...
Classical Gram-Schmidt (with DGKS correction) implementation of the Belos::OrthoManager class...
int getNumIters() const
Get the iteration count for the most recent call to solve().
void setParameters(const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
Set the parameters the solver manager should use to solve the linear problem.
A Belos::StatusTest class for specifying a maximum number of iterations.
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 achievedTol() const
Tolerance achieved by the last solve() invocation.
A linear system to solve, and its associated information.
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.
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
PCPGSolMgrLAPACKFailure(const std::string &what_arg)
PCPGSolMgr()
Empty constructor for PCPGSolMgr. This constructor takes no arguments and sets the default values for...
ReturnType
Whether the Belos solve converged for all linear systems.
The Belos::SolverManager is a templated virtual base class that defines the basic interface that any ...
Iterated Classical Gram-Schmidt (ICGS) implementation of the Belos::OrthoManager class.
void validateParameters(ParameterList const &validParamList, int const depth=1000, EValidateUsed const validateUsed=VALIDATE_USED_ENABLED, EValidateDefaults const validateDefaults=VALIDATE_DEFAULTS_ENABLED) const
An implementation of the Belos::MatOrthoManager that performs orthogonalization using multiple steps ...
Teuchos::RCP< MV > U
The recycled subspace.
An implementation of the Belos::MatOrthoManager that performs orthogonalization using multiple steps ...
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.
PCPGIterOrthoFailure is thrown when the PCPGIter object is unable to compute independent direction ve...
Belos::StatusTestResNorm for specifying general residual norm stopping criteria.
void setProblem(const Teuchos::RCP< LinearProblem< ScalarType, MV, OP > > &problem)
Set the linear problem that needs to be solved.
The Belos::PCPGSolMgr manages the PCPG linear solver. Three Hypotheses: First users must ensure that ...
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.
Teuchos::Array< Teuchos::RCP< Teuchos::Time > > getTimers() const
Return the timers for this object.
Parent class to all Belos exceptions.
bool isLOADetected() const
Return whether a loss of accuracy was detected by this solver during the most current solve...
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...
PCPGSolMgrLinearProblemFailure(const std::string &what_arg)
OrdinalType numRows() const