43 #include "MoochoPack_CalcReducedGradLagrangianStd_AddedStep.hpp" 44 #include "MoochoPack_NLPAlgoContainer.hpp" 45 #include "MoochoPack_moocho_algo_conversion.hpp" 46 #include "IterationPack_print_algorithm_step.hpp" 47 #include "AbstractLinAlgPack_MatrixOp.hpp" 48 #include "AbstractLinAlgPack_VectorSpace.hpp" 49 #include "AbstractLinAlgPack_VectorMutable.hpp" 50 #include "AbstractLinAlgPack_VectorOut.hpp" 51 #include "AbstractLinAlgPack_VectorStdOps.hpp" 52 #include "AbstractLinAlgPack_LinAlgOpPack.hpp" 61 bool CalcReducedGradLagrangianStd_AddedStep::do_step(
68 using LinAlgOpPack::V_MtV;
70 using LinAlgOpPack::Vp_MtV;
72 NLPAlgo &algo = rsqp_algo(_algo);
75 EJournalOutputLevel olevel = algo.algo_cntr().journal_output_level();
76 EJournalOutputLevel ns_olevel = algo.algo_cntr().null_space_journal_output_level();
80 if( static_cast<int>(ns_olevel) >= static_cast<int>(PRINT_ALGORITHM_STEPS) ) {
81 using IterationPack::print_algorithm_step;
82 print_algorithm_step( algo, step_poss, type, assoc_step_poss, out );
87 IterQuantityAccess<VectorMutable>
92 VectorMutable &rGL_k = rGL_iq.set_k(0);
94 if( nu_iq.updated_k(0) && nu_iq.get_k(0).nz() > 0 ) {
97 const Vector &nu_k = nu_iq.get_k(0);
98 VectorSpace::vec_mut_ptr_t
99 tmp = nu_k.space().create_member();
101 if( (
int)olevel >= (
int)PRINT_VECTORS )
102 out <<
"\nnu_k = \n" << nu_k;
103 V_VpV( tmp.get(), Gf_iq.get_k(0), nu_k );
104 if( (
int)olevel >= (int)PRINT_VECTORS )
105 out <<
"\nGf_k+nu_k = \n" << *tmp;
106 V_MtV( &rGL_k, s.Z().get_k(0),
trans, *tmp );
107 if( (
int)ns_olevel >= (int)PRINT_VECTORS )
108 out <<
"\nrGL_k = \n" << rGL_k;
111 rGL_k = s.rGf().get_k(0);
117 if( static_cast<int>(ns_olevel) >= static_cast<int>(PRINT_ALGORITHM_STEPS) ) {
118 out <<
"\n||rGL_k||inf = " << rGL_k.norm_inf() <<
"\n";
121 if( static_cast<int>(ns_olevel) >= static_cast<int>(PRINT_VECTORS) ) {
122 out <<
"\nrGL_k = \n" << rGL_k;
128 void CalcReducedGradLagrangianStd_AddedStep::print_step(
131 ,std::ostream& out,
const std::string& L
135 << L <<
"*** Evaluate the reduced gradient of the Lagrangian\n" 136 << L <<
"if nu_k is updated and nu_k.nz() > 0 then\n" 137 << L <<
" rGL_k = Z_k' * (Gf_k + nu_k) + Uz_k' * lambda_k(equ_undecomp)\n" 139 << L <<
" rGL_k = rGf_k + Uz_k' * lambda_k(equ_undecomp)\n"
void Vp_StV(VectorMutable *v_lhs, const value_type &alpha, const Vector &v_rhs)
rSQP Algorithm control class.
virtual std::ostream & journal_out() const
void V_VpV(VectorMutable *v_lhs, const V1 &V1_rhs1, const V2 &V2_rhs2)
Reduced space SQP state encapsulation interface.
AlgorithmTracker & track()
void Vp_StMtV(VectorMutable *v_lhs, value_type alpha, const MatrixOp &M_rhs1, BLAS_Cpp::Transp trans_rhs1, const Vector &v_rhs2, value_type beta=1.0)
NLPAlgoState & rsqp_state()
<<std aggr>="">> members for algo_cntr
void Vp_V(VectorMutable *v_lhs, const V &V_rhs)