534 if (params_ == Teuchos::null) {
542 if (params->isParameter(
"Maximum Iterations")) {
543 maxIters_ = params->get(
"Maximum Iterations",maxIters_default_);
546 params_->set(
"Maximum Iterations", maxIters_);
547 if (maxIterTest_!=Teuchos::null)
548 maxIterTest_->setMaxIters( maxIters_ );
552 if (params->isParameter(
"Num Blocks")) {
553 numBlocks_ = params->get(
"Num Blocks",numBlocks_default_);
554 TEUCHOS_TEST_FOR_EXCEPTION(numBlocks_ <= 0, std::invalid_argument,
555 "Belos::RCGSolMgr: \"Num Blocks\" must be strictly positive.");
558 params_->set(
"Num Blocks", numBlocks_);
562 if (params->isParameter(
"Num Recycled Blocks")) {
563 recycleBlocks_ = params->get(
"Num Recycled Blocks",recycleBlocks_default_);
564 TEUCHOS_TEST_FOR_EXCEPTION(recycleBlocks_ <= 0, std::invalid_argument,
565 "Belos::RCGSolMgr: \"Num Recycled Blocks\" must be strictly positive.");
567 TEUCHOS_TEST_FOR_EXCEPTION(recycleBlocks_ >= numBlocks_, std::invalid_argument,
568 "Belos::RCGSolMgr: \"Num Recycled Blocks\" must be less than \"Num Blocks\".");
571 params_->set(
"Num Recycled Blocks", recycleBlocks_);
575 if (params->isParameter(
"Timer Label")) {
576 std::string tempLabel = params->get(
"Timer Label", label_default_);
579 if (tempLabel != label_) {
581 params_->set(
"Timer Label", label_);
582 std::string solveLabel = label_ +
": RCGSolMgr total solve time";
583#ifdef BELOS_TEUCHOS_TIME_MONITOR
584 timerSolve_ = Teuchos::TimeMonitor::getNewCounter(solveLabel);
590 if (params->isParameter(
"Verbosity")) {
591 if (Teuchos::isParameterType<int>(*params,
"Verbosity")) {
592 verbosity_ = params->get(
"Verbosity", verbosity_default_);
594 verbosity_ = (int)Teuchos::getParameter<Belos::MsgType>(*params,
"Verbosity");
598 params_->set(
"Verbosity", verbosity_);
599 if (printer_ != Teuchos::null)
600 printer_->setVerbosity(verbosity_);
604 if (params->isParameter(
"Output Style")) {
605 if (Teuchos::isParameterType<int>(*params,
"Output Style")) {
606 outputStyle_ = params->get(
"Output Style", outputStyle_default_);
608 outputStyle_ = (int)Teuchos::getParameter<Belos::OutputType>(*params,
"Output Style");
612 params_->set(
"Output Style", outputStyle_);
613 outputTest_ = Teuchos::null;
617 if (params->isParameter(
"Output Stream")) {
618 outputStream_ = Teuchos::getParameter<Teuchos::RCP<std::ostream> >(*params,
"Output Stream");
621 params_->set(
"Output Stream", outputStream_);
622 if (printer_ != Teuchos::null)
623 printer_->setOStream( outputStream_ );
628 if (params->isParameter(
"Output Frequency")) {
629 outputFreq_ = params->get(
"Output Frequency", outputFreq_default_);
633 params_->set(
"Output Frequency", outputFreq_);
634 if (outputTest_ != Teuchos::null)
635 outputTest_->setOutputFrequency( outputFreq_ );
639 if (printer_ == Teuchos::null) {
648 if (params->isParameter(
"Convergence Tolerance")) {
649 if (params->isType<MagnitudeType> (
"Convergence Tolerance")) {
650 convtol_ = params->get (
"Convergence Tolerance",
658 params_->set(
"Convergence Tolerance", convtol_);
659 if (convTest_ != Teuchos::null)
660 convTest_->setTolerance( convtol_ );
663 if (params->isParameter(
"Show Maximum Residual Norm Only")) {
664 showMaxResNormOnly_ = Teuchos::getParameter<bool>(*params,
"Show Maximum Residual Norm Only");
667 params_->set(
"Show Maximum Residual Norm Only", showMaxResNormOnly_);
668 if (convTest_ != Teuchos::null)
669 convTest_->setShowMaxResNormOnly( showMaxResNormOnly_ );
675 if (maxIterTest_ == Teuchos::null)
679 if (convTest_ == Teuchos::null)
680 convTest_ = Teuchos::rcp(
new StatusTestResNorm_t( convtol_, 1 ) );
682 if (sTest_ == Teuchos::null) {
683 sTest_ = Teuchos::rcp(
new StatusTestCombo_t( StatusTestCombo_t::OR, maxIterTest_, convTest_ ) );
684 if (Teuchos::nonnull(debugStatusTest_)) {
686 sTest_ = Teuchos::rcp(
new StatusTestCombo_t( StatusTestCombo_t::OR, sTest_, debugStatusTest_ ) );
690 if (outputTest_ == Teuchos::null) {
698 std::string solverDesc =
" Recycling CG ";
699 outputTest_->setSolverDesc( solverDesc );
703 if (timerSolve_ == Teuchos::null) {
704 std::string solveLabel = label_ +
": RCGSolMgr total solve time";
705#ifdef BELOS_TEUCHOS_TIME_MONITOR
706 timerSolve_ = Teuchos::TimeMonitor::getNewCounter(solveLabel);
1050 Teuchos::BLAS<int,ScalarType> blas;
1051 Teuchos::LAPACK<int,ScalarType> lapack;
1052 ScalarType one = Teuchos::ScalarTraits<ScalarType>::one();
1053 ScalarType zero = Teuchos::ScalarTraits<ScalarType>::zero();
1055 std::vector<int> index(1), rindex(recycleBlocks_), nindex(numBlocks_);
1056 for (
int i=0; i<recycleBlocks_; ++i) { rindex[i] = i; }
1057 for (
int i=0; i<numBlocks_; ++i) { nindex[i] = i; }
1070 "Belos::RCGSolMgr::solve(): Linear problem is not a valid object.");
1072 "Belos::RCGSolMgr::solve(): Linear problem is not ready, setProblem() has not been called.");
1073 TEUCHOS_TEST_FOR_EXCEPTION((problem_->getLeftPrec() != Teuchos::null)&&(problem_->getRightPrec() != Teuchos::null),
1075 "Belos::RCGSolMgr::solve(): RCG does not support split preconditioning, only set left or right preconditioner.");
1078 Teuchos::RCP<OP> precObj;
1079 if (problem_->getLeftPrec() != Teuchos::null) {
1080 precObj = Teuchos::rcp_const_cast<OP>(problem_->getLeftPrec());
1082 else if (problem_->getRightPrec() != Teuchos::null) {
1083 precObj = Teuchos::rcp_const_cast<OP>(problem_->getRightPrec());
1088 std::vector<int> currIdx(1);
1092 problem_->setLSIndex( currIdx );
1096 if (numBlocks_ > dim) {
1097 numBlocks_ = Teuchos::asSafe<int>(dim);
1098 params_->set(
"Num Blocks", numBlocks_);
1100 "Warning! Requested Krylov subspace dimension is larger than operator dimension!" << std::endl <<
1101 " The maximum number of blocks allowed for the Krylov subspace will be adjusted to " << numBlocks_ << std::endl;
1105 initializeStateStorage();
1108 Teuchos::ParameterList plist;
1109 plist.set(
"Num Blocks",numBlocks_);
1110 plist.set(
"Recycled Blocks",recycleBlocks_);
1113 outputTest_->reset();
1116 bool isConverged =
true;
1123 problem_->applyOp( *Utmp, *AUtmp );
1127 if ( precObj != Teuchos::null ) {
1139 Teuchos::RCP<RCGIter<ScalarType,MV,OP,DM> > rcg_iter;
1144#ifdef BELOS_TEUCHOS_TIME_MONITOR
1145 Teuchos::TimeMonitor slvtimer(*timerSolve_);
1148 while ( numRHS2Solve > 0 ) {
1151 if (printer_->isVerbosity(
Debug ) ) {
1152 if (existU_) printer_->print(
Debug,
"Using recycle space generated from previous call to solve()." );
1153 else printer_->print(
Debug,
"No recycle space exists." );
1157 rcg_iter->resetNumIters();
1160 rcg_iter->setSize( recycleBlocks_, numBlocks_ );
1163 outputTest_->resetNumCalls();
1172 problem_->computeCurrResVec( &*r_ );
1177 Teuchos::RCP<DM> Utr =
DMT::Create(recycleBlocks_,1);
1189 "Belos::RCGSolMgr::solve(): LAPACK GESV failed to compute a solution.");
1200 if ( precObj != Teuchos::null ) {
1211 Teuchos::RCP<DM> mu =
DMT::Subview(*Delta_, recycleBlocks_, 1);
1221 "Belos::RCGSolMgr::solve(): LAPACK GETRS failed to compute a solution.");
1242 index.resize( numBlocks_+1 );
1243 for (
int ii=0; ii<(numBlocks_+1); ++ii) { index[ii] = ii; }
1247 newstate.
Alpha = Alpha_;
1248 newstate.
Beta = Beta_;
1251 newstate.
Delta = Delta_;
1252 newstate.
LUUTAU = LUUTAU_;
1258 newstate.
existU = existU_;
1259 newstate.
ipiv = ipiv_;
1262 rcg_iter->initialize(newstate);
1268 rcg_iter->iterate();
1275 if ( convTest_->getStatus() ==
Passed ) {
1284 else if ( maxIterTest_->getStatus() ==
Passed ) {
1287 isConverged =
false;
1295 else if ( rcg_iter->getCurSubspaceDim() == rcg_iter->getMaxSubspaceDim() ) {
1300 if (recycleBlocks_ > 0) {
1304 Teuchos::RCP<DM> Ftmp =
DMT::Subview( *F_, numBlocks_, numBlocks_ );
1305 Teuchos::RCP<DM> Gtmp =
DMT::Subview( *G_, numBlocks_, numBlocks_ );
1310 for (
int ii=0;ii<numBlocks_;ii++) {
1311 DMT::Value(*Gtmp,ii,ii) = ((*D_)[ii] / (*Alpha_)[ii])*(1 + (*Beta_)[ii]);
1313 DMT::Value(*Gtmp,ii-1,ii) = -(*D_)[ii]/(*Alpha_)[ii-1];
1314 DMT::Value(*Gtmp,ii,ii-1) = -(*D_)[ii]/(*Alpha_)[ii-1];
1323 Teuchos::RCP<DM> Ytmp =
DMT::Subview( *Y_, numBlocks_, recycleBlocks_ );
1324 getHarmonicVecs(*Ftmp,*Gtmp,*Ytmp);
1339 Teuchos::RCP<DM> GYtmp =
DMT::Subview( *GY_, numBlocks_, recycleBlocks_ );
1341 blas.GEMM( Teuchos::NO_TRANS, Teuchos::NO_TRANS, numBlocks_, recycleBlocks_, numBlocks_,
1346 blas.GEMM( Teuchos::TRANS, Teuchos::NO_TRANS, recycleBlocks_, recycleBlocks_, numBlocks_,
1353 Teuchos::RCP<DM> FYtmp =
DMT::Subview( *FY_, numBlocks_, recycleBlocks_ );
1355 blas.GEMM( Teuchos::NO_TRANS, Teuchos::NO_TRANS, numBlocks_, recycleBlocks_, numBlocks_,
1360 blas.GEMM( Teuchos::TRANS, Teuchos::NO_TRANS, recycleBlocks_, recycleBlocks_, numBlocks_,
1369 Teuchos::RCP<DM> AU1TAPtmp =
DMT::Subview( *AU1TAP_, recycleBlocks_, 1 );
1374 ScalarType alphatmp = -1.0 / (*Alpha_)[numBlocks_-1];
1375 for (
int ii=0; ii<recycleBlocks_; ++ii) {
1385 lastBeta = numBlocks_-1;
1396 for (
int ii=0; ii<numBlocks_; ii++) {
1397 DMT::Value(*APTAP_,ii,ii) = ((*D_)[ii] / (*Alpha_)[ii])*(1 + (*Beta_)[ii+1]);
1399 DMT::Value(*APTAP_,ii-1,ii) = -(*D_)[ii]/(*Alpha_)[ii-1];
1400 DMT::Value(*APTAP_,ii,ii-1) = -(*D_)[ii]/(*Alpha_)[ii-1];
1407 Teuchos::RCP<DM> F11 =
DMT::Subview( *F_, recycleBlocks_, recycleBlocks_ );
1408 Teuchos::RCP<DM> F22 =
DMT::Subview( *F_, numBlocks_, numBlocks_, recycleBlocks_, recycleBlocks_ );
1411 for(
int ii=0;ii<numBlocks_;ii++) {
1417 Teuchos::RCP<DM> G11 =
DMT::Subview( *G_, recycleBlocks_, recycleBlocks_ );
1418 Teuchos::RCP<DM> G12 =
DMT::Subview( *G_, recycleBlocks_, numBlocks_, 0, recycleBlocks_ );
1419 Teuchos::RCP<DM> G21 =
DMT::Subview( *G_, numBlocks_, recycleBlocks_, recycleBlocks_, 0 );
1420 Teuchos::RCP<DM> G22 =
DMT::Subview( *G_, numBlocks_, numBlocks_, recycleBlocks_, recycleBlocks_ );
1426 for (
int ii=0;ii<recycleBlocks_;++ii)
1427 for (
int jj=0;jj<numBlocks_;++jj)
1432 getHarmonicVecs(*F_,*G_,*Y_);
1436 index.resize( numBlocks_ );
1437 for (
int ii=0; ii<numBlocks_; ++ii) { index[ii] = ii+1; }
1442 Teuchos::RCP<const DM> Y1 =
DMT::SubviewConst( *Y_, recycleBlocks_, recycleBlocks_ );
1443 Teuchos::RCP<const DM> Y2 =
DMT::SubviewConst( *Y_, numBlocks_, recycleBlocks_, recycleBlocks_, 0 );
1454 blas.GEMM( Teuchos::NO_TRANS, Teuchos::NO_TRANS, numBlocks_+recycleBlocks_,
1455 recycleBlocks_, numBlocks_+recycleBlocks_,
1460 blas.GEMM( Teuchos::TRANS, Teuchos::NO_TRANS, recycleBlocks_, recycleBlocks_,
1461 numBlocks_+recycleBlocks_,
1472 ScalarType alphatmp = -1.0 / (*Alpha_)[numBlocks_-1];
1474 for (
int ii=0; ii<recycleBlocks_; ++ii) {
1484 blas.GEMM( Teuchos::NO_TRANS, Teuchos::NO_TRANS, numBlocks_+recycleBlocks_,
1485 recycleBlocks_, numBlocks_+recycleBlocks_,
1490 blas.GEMM( Teuchos::TRANS, Teuchos::NO_TRANS, recycleBlocks_, recycleBlocks_,
1491 numBlocks_+recycleBlocks_,
1500 lastp = numBlocks_+1;
1501 lastBeta = numBlocks_;
1509 for (
int ii=0; ii<numBlocks_; ii++) {
1510 DMT::Value(*APTAP_,ii,ii) = ((*D_)[ii] / (*Alpha_)[ii])*(1 + (*Beta_)[ii]);
1512 DMT::Value(*APTAP_,ii-1,ii) = -(*D_)[ii]/(*Alpha_)[ii-1];
1513 DMT::Value(*APTAP_,ii,ii-1) = -(*D_)[ii]/(*Alpha_)[ii-1];
1520 for(
int ii=0;ii<numBlocks_;ii++) {
1522 DMT::Value(*L2_,ii+1,ii) = -1./(*Alpha_)[ii];
1533 blas.GEMM( Teuchos::NO_TRANS, Teuchos::NO_TRANS, recycleBlocks_, numBlocks_, numBlocks_+1,
1538 blas.GEMM( Teuchos::NO_TRANS, Teuchos::NO_TRANS, recycleBlocks_, numBlocks_, recycleBlocks_,
1548 Teuchos::RCP<DM> F11 =
DMT::Subview( *F_, recycleBlocks_, recycleBlocks_ );
1549 Teuchos::RCP<DM> F22 =
DMT::Subview( *F_, numBlocks_, numBlocks_, recycleBlocks_, recycleBlocks_ );
1552 for(
int ii=0;ii<numBlocks_;ii++) {
1558 Teuchos::RCP<DM> G11 =
DMT::Subview( *G_, recycleBlocks_, recycleBlocks_ );
1559 Teuchos::RCP<DM> G12 =
DMT::Subview( *G_, recycleBlocks_, numBlocks_, 0, recycleBlocks_ );
1560 Teuchos::RCP<DM> G21 =
DMT::Subview( *G_, numBlocks_, recycleBlocks_, recycleBlocks_, 0 );
1561 Teuchos::RCP<DM> G22 =
DMT::Subview( *G_, numBlocks_, numBlocks_, recycleBlocks_, recycleBlocks_ );
1567 for (
int ii=0;ii<recycleBlocks_;++ii)
1568 for (
int jj=0;jj<numBlocks_;++jj)
1573 getHarmonicVecs(*F_,*G_,*Y_);
1582 Teuchos::RCP<const DM> Y1 =
DMT::SubviewConst( *Y_, recycleBlocks_, recycleBlocks_ );
1583 Teuchos::RCP<const DM> Y2 =
DMT::SubviewConst( *Y_, numBlocks_, recycleBlocks_, recycleBlocks_, 0 );
1596 blas.GEMM( Teuchos::NO_TRANS, Teuchos::NO_TRANS, numBlocks_+recycleBlocks_,
1597 recycleBlocks_, numBlocks_+recycleBlocks_,
1602 blas.GEMM( Teuchos::TRANS, Teuchos::NO_TRANS, recycleBlocks_, recycleBlocks_,
1603 numBlocks_+recycleBlocks_,
1610 blas.GEMM( Teuchos::NO_TRANS, Teuchos::NO_TRANS, numBlocks_+recycleBlocks_,
1611 recycleBlocks_, numBlocks_+recycleBlocks_,
1616 blas.GEMM( Teuchos::TRANS, Teuchos::NO_TRANS, recycleBlocks_, recycleBlocks_,
1617 numBlocks_+recycleBlocks_,
1631 dold = (*D_)[numBlocks_-1];
1638 lastBeta = numBlocks_-1;
1643 for (
int ii=0; ii<numBlocks_; ii++) {
1644 DMT::Value(*APTAP_,ii,ii) = ((*D_)[ii] / (*Alpha_)[ii])*(1 + (*Beta_)[ii+1]);
1646 DMT::Value(*APTAP_,ii-1,ii) = -(*D_)[ii]/(*Alpha_)[ii-1];
1647 DMT::Value(*APTAP_,ii,ii-1) = -(*D_)[ii]/(*Alpha_)[ii-1];
1653 for(
int ii=0;ii<numBlocks_;ii++) {
1655 DMT::Value(*L2_,ii+1,ii) = -1./(*Alpha_)[ii];
1667 blas.GEMM( Teuchos::NO_TRANS, Teuchos::NO_TRANS, recycleBlocks_, numBlocks_, numBlocks_+1,
1672 blas.GEMM( Teuchos::NO_TRANS, Teuchos::NO_TRANS, recycleBlocks_, numBlocks_, recycleBlocks_,
1678 Teuchos::RCP<const DM> Y1 =
DMT::SubviewConst( *Y_, recycleBlocks_, recycleBlocks_ );
1679 Teuchos::RCP<const DM> Y2 =
DMT::SubviewConst( *Y_, numBlocks_, recycleBlocks_, recycleBlocks_, 0 );
1682 blas.GEMM( Teuchos::TRANS, Teuchos::NO_TRANS, recycleBlocks_, numBlocks_, recycleBlocks_,
1686 ScalarType val = dold * (-(*Beta_)[0]/(*Alpha_)[0]);
1687 for(
int ii=0;ii<recycleBlocks_;ii++) {
1693 Teuchos::RCP<DM> Y1TAU1TU =
DMT::Subview( *GY_, recycleBlocks_, recycleBlocks_ );
1695 blas.GEMM( Teuchos::TRANS, Teuchos::NO_TRANS, recycleBlocks_, recycleBlocks_, recycleBlocks_,
1704 Teuchos::RCP<DM> F11 =
DMT::Subview( *F_, recycleBlocks_, recycleBlocks_ );
1705 Teuchos::RCP<DM> F22 =
DMT::Subview( *F_, numBlocks_, numBlocks_, recycleBlocks_, recycleBlocks_ );
1708 for(
int ii=0;ii<numBlocks_;ii++) {
1714 Teuchos::RCP<DM> G11 =
DMT::Subview( *G_, recycleBlocks_, recycleBlocks_ );
1715 Teuchos::RCP<DM> G12 =
DMT::Subview( *G_, recycleBlocks_, numBlocks_, 0, recycleBlocks_ );
1716 Teuchos::RCP<DM> G21 =
DMT::Subview( *G_, numBlocks_, recycleBlocks_, recycleBlocks_, 0 );
1717 Teuchos::RCP<DM> G22 =
DMT::Subview( *G_, numBlocks_, numBlocks_, recycleBlocks_, recycleBlocks_ );
1723 for (
int ii=0;ii<recycleBlocks_;++ii)
1724 for (
int jj=0;jj<numBlocks_;++jj)
1729 getHarmonicVecs(*F_,*G_,*Y_);
1733 index.resize( numBlocks_ );
1734 for (
int ii=0; ii<numBlocks_; ++ii) { index[ii] = ii+1; }
1751 blas.GEMM( Teuchos::NO_TRANS, Teuchos::NO_TRANS, numBlocks_+recycleBlocks_,
1752 recycleBlocks_, numBlocks_+recycleBlocks_,
1757 blas.GEMM( Teuchos::TRANS, Teuchos::NO_TRANS, recycleBlocks_, recycleBlocks_,
1758 numBlocks_+recycleBlocks_,
1765 blas.GEMM( Teuchos::NO_TRANS, Teuchos::NO_TRANS, numBlocks_+recycleBlocks_,
1766 recycleBlocks_, numBlocks_+recycleBlocks_,
1771 blas.GEMM( Teuchos::TRANS, Teuchos::NO_TRANS, recycleBlocks_, recycleBlocks_,
1772 numBlocks_+recycleBlocks_,
1783 dold = (*D_)[numBlocks_-1];
1786 lastp = numBlocks_+1;
1787 lastBeta = numBlocks_;
1797 index[0] = lastp-1; index[1] = lastp;
1799 index[0] = 0; index[1] = 1;
1803 (*Beta_)[0] = (*Beta_)[lastBeta];
1807 Teuchos::RCP<DM> mu1 =
DMT::Subview( *Delta_, recycleBlocks_, 1, 0, 0 );
1808 Teuchos::RCP<DM> mu2 =
DMT::Subview( *Delta_, recycleBlocks_, 1, 0, numBlocks_ );
1813 newstate.
P = Teuchos::null;
1814 index.resize( numBlocks_+1 );
1815 for (
int ii=0; ii<(numBlocks_+1); ++ii) { index[ii] = ii+1; }
1818 newstate.
Beta = Beta_;
1821 newstate.
Delta = Delta_;
1826 rcg_iter->initialize(newstate);
1837 else if (Teuchos::nonnull(debugStatusTest_) &&
1838 debugStatusTest_->getStatus() ==
Passed) {
1841 isConverged =
false;
1852 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::logic_error,
1853 "Belos::RCGSolMgr::solve(): Invalid return from RCGIter::iterate().");
1859 achievedTol_ = MT::one();
1860 Teuchos::RCP<MV> X = problem_->getLHS();
1862 printer_->stream(
Warnings) <<
"Belos::RCGSolMgr::solve(): Warning! NaN has been detected!"
1866 catch (
const std::exception &e) {
1868 printer_->stream(
Errors) <<
"Error! Caught std::exception in RCGIter::iterate() at iteration "
1869 << rcg_iter->getNumIters() << std::endl
1870 << e.what() << std::endl;
1876 problem_->setCurrLS();
1880 if ( numRHS2Solve > 0 ) {
1883 problem_->setLSIndex( currIdx );
1886 currIdx.resize( numRHS2Solve );
1895 if (numRHS2Solve > 0) {
1897 newstate.
P = Teuchos::null;
1898 newstate.
Ap = Teuchos::null;
1899 newstate.
r = Teuchos::null;
1900 newstate.
z = Teuchos::null;
1901 newstate.
U = Teuchos::null;
1902 newstate.
AU = Teuchos::null;
1903 newstate.
Alpha = Teuchos::null;
1904 newstate.
Beta = Teuchos::null;
1906 newstate.
D = Teuchos::null;
1907 newstate.
Delta = Teuchos::null;
1908 newstate.
LUUTAU = Teuchos::null;
1909 newstate.
ipiv = Teuchos::null;
1910 newstate.
rTz_old = Teuchos::null;
1916 problem_->applyOp( *Utmp, *AUtmp );
1920 if ( precObj != Teuchos::null ) {
1938#ifdef BELOS_TEUCHOS_TIME_MONITOR
1943 Teuchos::TimeMonitor::summarize( printer_->stream(
TimingDetails) );
1947 numIters_ = maxIterTest_->getNumIters();
1951 using Teuchos::rcp_dynamic_cast;
1954 const std::vector<MagnitudeType>* pTestValues =
1955 rcp_dynamic_cast<conv_test_type>(convTest_)->
getTestValue();
1957 TEUCHOS_TEST_FOR_EXCEPTION(pTestValues == NULL, std::logic_error,
1958 "Belos::RCGSolMgr::solve(): The convergence test's getTestValue() "
1959 "method returned NULL. Please report this bug to the Belos developers.");
1961 TEUCHOS_TEST_FOR_EXCEPTION(pTestValues->size() < 1, std::logic_error,
1962 "Belos::RCGSolMgr::solve(): The convergence test's getTestValue() "
1963 "method returned a vector of length zero. Please report this bug to the "
1964 "Belos developers.");
1969 achievedTol_ = *std::max_element (pTestValues->begin(), pTestValues->end());