61 namespace MoochoPack {
77 NLP &nlp = algo.nlp();
82 if(!nlp.is_initialized())
83 nlp.initialize(algo.algo_cntr().check_results());
92 IterQuantityAccess<VectorMutable> &x_iq = s.x();
93 IterQuantityAccess<MatrixSymDiagStd> &Vl_iq = s.Vl();
94 IterQuantityAccess<MatrixSymDiagStd> &Vu_iq = s.Vu();
102 VectorMutable& x = x_iq.get_k(0);
103 MatrixSymDiagStd& invXu = s.invXu().set_k(0);
104 MatrixSymDiagStd& invXl = s.invXl().set_k(0);
125 if ( Vu_iq.last_updated() == IterQuantity::NONE_UPDATED )
127 VectorMutable& vu = Vu_iq.set_k(0).diag();
129 Vp_StV(&vu, s.barrier_parameter().get_k(-1), invXu.diag());
133 out <<
"\nInitialize Vu with barrier_parameter * invXu ...\n";
137 if ( Vl_iq.last_updated() == IterQuantity::NONE_UPDATED )
139 VectorMutable& vl = Vl_iq.set_k(0).diag();
141 Vp_StV(&vl, s.barrier_parameter().get_k(-1), invXl.diag());
145 out <<
"\nInitialize Vl with barrier_parameter * invXl ...\n";
149 if (s.num_basis().updated_k(0))
152 if (Vu_iq.updated_k(-1))
153 { Vu_iq.set_k(0,-1); }
154 if (Vl_iq.updated_k(-1))
155 { Vl_iq.set_k(0,-1); }
157 VectorMutable& vu = Vu_iq.set_k(0).diag();
158 VectorMutable& vl = Vl_iq.set_k(0).diag();
165 out <<
"\nx resorted vl and vu to the original order\n" << x;
171 if( (
int)olevel >= (
int)PRINT_VECTORS )
173 out <<
"\nx resorted to new basis \n" << x;
182 out <<
"x=\n" << s.x().get_k(0);
183 out <<
"xl=\n" << nlp.xl();
184 out <<
"vl=\n" << s.Vl().get_k(0).diag();
185 out <<
"xu=\n" << nlp.xu();
186 out <<
"vu=\n" << s.Vu().get_k(0).diag();
190 VectorMutable& v = s.nu().set_k(0);
191 v = Vu_iq.get_k(0).diag();
192 Vp_StV(&v,-1.0,Vl_iq.get_k(0).diag());
195 if( static_cast<int>(olevel) >=
static_cast<int>(
PRINT_VECTORS) )
197 out <<
"invXu_k.diag()=\n" << invXu.diag();
198 out <<
"invXl_k.diag()=\n" << invXl.diag();
199 out <<
"Vu_k.diag()=\n" << Vu_iq.get_k(0).diag();
200 out <<
"Vl_k.diag()=\n" << Vl_iq.get_k(0).diag();
201 out <<
"nu_k=\n" << s.nu().get_k(0);
210 ,
poss_type assoc_step_poss, std::ostream&
out,
const std::string& L
215 out << L <<
"# Evaluate information specific to primal / dual barrier algorithms (Post EvalNewPoint)\n"
216 << L <<
"invXl_k = diag(i, 1/(x(i)-xl))"
217 << L <<
"invXu_k = diag(i, 1/(xu-x(i)))\n"
218 << L <<
"if (Vu_k not updated) then\n"
219 << L <<
" Vu_k = mu_k*invXu_k\n"
221 << L <<
"if (Vl_k not updated) then\n"
222 << L <<
" Vl_k = mu_k*invXl_k\n"
224 << L <<
"nu_k_k = Vu_k.diag() - Vl_k.diag()\n";
void inv_of_difference(const value_type alpha, const Vector &v0, const Vector &v1, VectorMutable *z)
Computes the inverse of the difference between two vectors.
void Vp_StV(VectorMutable *v_lhs, const value_type &alpha, const Vector &v_rhs)
v_lhs = alpha * v_rhs + v_lhs
rSQP Algorithm control class.
virtual std::ostream & journal_out() const
Return a reference to a std::ostream to be used to output debug information and the like...
EJournalOutputLevel
enum for journal output.
T_To & dyn_cast(T_From &from)
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)
AlgorithmTracker & track()
bool assert_print_nan_inf(const value_type &val, const char name[], bool throw_excpt, std::ostream *out)
This function asserts if a value_type scalare is a NaN or Inf and optionally prints out these entires...
Acts as the central hub for an iterative algorithm.
void correct_lower_bound_multipliers(const Vector &xl, const value_type inf_bound_limit, VectorMutable *vl)
Corrects the lower bound multipliers with infinite bounds.
void print_step(const IterationPack::Algorithm &algo, poss_type step_poss, IterationPack::EDoStepType type, poss_type assoc_step_poss, std::ostream &out, const std::string &leading_str) const
Called by Algorithm::print_algorithm() to print out what this step does in Matlab like format...
void correct_upper_bound_multipliers(const Vector &xu, const value_type inf_bound_limit, VectorMutable *vu)
Corrects the upper bound multipliers with infinite bounds.