47 #include "AbstractLinAlgPack_VectorAuxiliaryOps.hpp" 48 #include "AbstractLinAlgPack_MatrixSymDiagStd.hpp" 49 #include "AbstractLinAlgPack_VectorStdOps.hpp" 50 #include "AbstractLinAlgPack_VectorOut.hpp" 51 #include "NLPInterfacePack_NLPBarrier.hpp" 52 #include "MoochoPack_PostProcessBarrierLineSearch_Step.hpp" 53 #include "MoochoPack_IpState.hpp" 54 #include "MoochoPack_moocho_algo_conversion.hpp" 55 #include "IterationPack_print_algorithm_step.hpp" 56 #include "Teuchos_dyn_cast.hpp" 57 #include "Teuchos_Assert.hpp" 59 #define min(a,b) ( (a < b) ? a : b ) 60 #define max(a,b) ( (a > b) ? a : b ) 65 Teuchos::RCP<NLPInterfacePack::NLPBarrier> barrier_nlp
68 barrier_nlp_(barrier_nlp)
70 TEUCHOS_TEST_FOR_EXCEPTION(
73 "PostProcessBarrierLineSearch_Step given NULL NLPBarrier." 83 using Teuchos::dyn_cast;
84 using IterationPack::print_algorithm_step;
88 IpState &s = dyn_cast<IpState>(_algo.
state());
90 EJournalOutputLevel olevel = algo.algo_cntr().journal_output_level();
94 if( static_cast<int>(olevel) >= static_cast<int>(PRINT_ALGORITHM_STEPS) )
96 using IterationPack::print_algorithm_step;
97 print_algorithm_step( _algo, step_poss, type, assoc_step_poss, out );
101 value_type& f_kp1 = s.f().set_k(+1);
102 f_kp1 = barrier_nlp_->objective_term();
104 VectorMutable& Gf_kp1 = s.Gf().set_k(+1);
105 Gf_kp1 = *(barrier_nlp_->grad_objective_term());
107 if( static_cast<int>(olevel) >=
static_cast<int>(PRINT_ALGORITHM_STEPS) )
109 out <<
"\nf = " << f_kp1
110 <<
"\nbarrier_term = " << barrier_nlp_->barrier_term() << std::endl;
114 if( static_cast<int>(olevel) >= static_cast<int>(PRINT_VECTORS) )
116 out <<
"Gf = \n" << Gf_kp1
117 <<
"\ngrad_barrier_term = \n" << *(barrier_nlp_->grad_barrier_term());
124 void PostProcessBarrierLineSearch_Step::print_step(
126 ,
poss_type assoc_step_poss, std::ostream& out,
const std::string& L
131 out << L <<
"# Process out the temporary barrier term used for line search\n" 132 << L <<
"f_k -= barrier_term_k\n";
bool do_step(Algorithm &algo, poss_type step_poss, IterationPack::EDoStepType type, poss_type assoc_step_poss)
PostProcessBarrierLineSearch_Step(Teuchos::RCP< NLPInterfacePack::NLPBarrier > barrier_nlp)
Constructor.
void Vp_StV(VectorMutable *v_lhs, const value_type &alpha, const Vector &v_rhs)
rSQP Algorithm control class.
virtual std::ostream & journal_out() const
AlgorithmTracker & track()