46 #include "MoochoPack_CheckConvergenceStd_AddedStep.hpp" 47 #include "MoochoPack_NLPAlgoContainer.hpp" 48 #include "MoochoPack_moocho_algo_conversion.hpp" 49 #include "IterationPack_print_algorithm_step.hpp" 54 Teuchos::RCP<CheckConvergence_Strategy> convergence_strategy
57 convergence_strategy_(convergence_strategy)
66 TEUCHOS_TEST_FOR_EXCEPTION(!convergence_strategy_.get(),
68 "Don't have a valid convergence_strategy in CheckConvergenceStd_AddedStep\n" 71 NLPAlgo &algo = rsqp_algo(_algo);
73 EJournalOutputLevel olevel = algo.algo_cntr().journal_output_level();
74 std::ostream& out = algo.track().journal_out();
77 if( static_cast<int>(olevel) >= static_cast<int>(PRINT_ALGORITHM_STEPS) ) {
78 using IterationPack::print_algorithm_step;
79 print_algorithm_step( algo, step_poss, type, assoc_step_poss, out );
82 const bool found_solution = convergence_strategy_->Converged(_algo);
86 if( static_cast<int>(olevel) > static_cast<int>(PRINT_NOTHING) )
87 out <<
"\nJackpot! Found the solution!!!!!! (k = " << algo.state().k() <<
")\n";
92 if( static_cast<int>(olevel) > static_cast<int>(PRINT_NOTHING) )
93 out <<
"\nHave not found the solution yet, have to keep going (k = " << algo.state().k() <<
") :-(\n";
101 , std::ostream& out,
const std::string& L )
const 104 TEUCHOS_TEST_FOR_EXCEPTION(!convergence_strategy_.get(),
106 "Don't have a valid convergence_strategy in CheckConvergenceStd_AddedStep\n" 109 convergence_strategy_->print_step(algo, out, L);
rSQP Algorithm control class.
bool do_step(Algorithm &algo, poss_type step_poss, IterationPack::EDoStepType type, poss_type assoc_step_poss)
void print_step(const Algorithm &algo, poss_type step_poss, IterationPack::EDoStepType type, poss_type assoc_step_poss, std::ostream &out, const std::string &leading_str) const
CheckConvergenceStd_AddedStep(Teuchos::RCP< CheckConvergence_Strategy > convergence_strategy)