50 #include "ConstrainedOptPack/src/VectorWithNorms.h"
52 #include "AbstractLinAlgPack/src/AbstractLinAlgPack_MatrixOp.hpp"
57 namespace LinAlgOpPack {
81 NLPAlgoState &s = algo.rsqp_state();
82 Range1D decomp = s.equ_decomp();
85 std::ostream&
out = algo.track().journal_out();
99 if( !s.lambda().updated_k(0) ) s.lambda().set_k(0).v().resize( algo.nlp().m() );
101 DVectorSlice lambda_decomp = s.lambda().get_k(0).v()(decomp);
104 if( algo.nlp().has_bounds() ) {
106 DVector _tmp = s.Gf().get_k(0)();
108 Vp_V( &_vs_tmp, s.nu().get_k(0)() );
110 V_StMtV( &lambda_decomp, -1.0, s.Y().get_k(0),
trans, _vs_tmp );
114 V_StMtV( &lambda_decomp, -1.0, s.Y().get_k(0),
trans, s.Gf().get_k(0)() );
118 if( algo.nlp().r() < algo.nlp().m() ) {
119 Range1D undecomp = s.equ_undecomp();
120 Vp_StMtV( &lambda_decomp, -1.0, s.U().get_k(0),
trans, s.lambda().get_k(0).v()(undecomp) );
125 s.decomp_sys().solve_transAtY( lambda_decomp,
trans, &lambda_decomp );
128 out <<
"\nmax(|lambda_k(equ_decomp)(i)|) = " <<
norm_inf(lambda_decomp)
129 <<
"\nmin(|lambda_k(equ_decomp)(i)|) = " <<
min_abs(lambda_decomp) << std::endl;
132 if( static_cast<int>(olevel) >= static_cast<int>(
PRINT_VECTORS) ) {
133 out <<
"\nlambda_k(equ_decomp) = \n" << lambda_decomp;
141 , std::ostream& out,
const std::string& L )
const
144 << L <<
"*** Calculate the Lagrange multipliers for the decomposed constraints\n"
145 << L <<
"lambda_k(equ_decomp) = - inv(Gc_k(:,equ_decomp)'*Y_k)\n"
146 << L <<
" * (Y_k'*(Gf_k + nu_k) + U_k'*lambda_k(equ_undecomp))\n";
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
void Vp_StV(VectorMutable *v_lhs, const value_type &alpha, const Vector &v_rhs)
v_lhs = alpha * v_rhs + v_lhs
void V_StMtV(VectorMutable *v_lhs, value_type alpha, const MatrixOp &M_rhs1, BLAS_Cpp::Transp trans_rhs1, const V &V_rhs2)
v_lhs = alpha * op(M_rhs1) * V_rhs2.
void Vp_MtV(VectorMutable *v_lhs, const MatrixOp &M_rhs1, BLAS_Cpp::Transp trans_rhs1, const V &V_rhs2)
v_lhs += op(M_rhs1) * V_rhs2.
EJournalOutputLevel
enum for journal output.
void print_algorithm_step(const Algorithm &algo, Algorithm::poss_type step_poss, EDoStepType type, Algorithm::poss_type assoc_step_poss, std::ostream &out)
Prints to 'out' the algorithm step.
bool do_step(Algorithm &algo, poss_type step_poss, IterationPack::EDoStepType type, poss_type assoc_step_poss)
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)
v_lhs = alpha * op(M_rhs1) * v_rhs2 + beta * v_lhs (BLAS xGEMV)
value_type norm_inf(const SparseVectorSlice< T_Ele > &sv_rhs)
result = ||sv_rhs||inf (BLAS IxAMAX)
DenseLinAlgPack::VectorSliceTmpl< value_type > DVectorSlice
void Vt_S(DVectorSlice *vs_lhs, value_type alpha)
vs_lhs *= alpha (BLAS xSCAL) (*** Note that alpha == 0.0 is handeled as vs_lhs = 0.0)
value_type min_abs(const DVectorSlice &mu)
Minimum |mu(i)|.
value_type norm_inf(const DVectorSlice &vs_rhs)
result = ||vs_rhs||infinity (BLAS IxAMAX)
RangePack::Range1D Range1D
NLPAlgo & rsqp_algo(Algorithm &algo)
Convert from a Algorithm to a NLPAlgo.
void Vp_V(VectorMutable *v_lhs, const V &V_rhs)
v_lhs += V_rhs.