57 namespace MoochoPack {
64 :AlgorithmTracker(journal_out)
66 ,opt_error_(opt_error)
67 ,num_total_qp_iter_(0)
86 const NLP &nlp = _algo.nlp();
91 std::ostream&
o = this->
o();
120 value_type norm_2_Ypy = -1.0, norm_2_Zpz = -1.0;
121 bool Ypy_exists, Zpz_exists;
122 if( m && ( Ypy_exists = s.Ypy().updated_k(0) ) )
123 norm_2_Ypy = s.Ypy().get_k(0).norm_2();
124 if( Zpz_exists = s.Zpz().updated_k(0) )
125 norm_2_Zpz = s.Zpz().get_k(0).norm_2();
130 if( s.f().updated_k(0) )
131 o << setw(w) << s.f().get_k(0);
135 if( s.Gf().updated_k(0) )
136 o << setw(w) << s.Gf().get_k(0).norm_inf();
140 if( m && s.c().updated_k(0) )
142 << s.c().get_k(0).norm_inf();
147 const IterQuantityAccess<VectorMutable>
149 ? s.rGL() : s.GL() );
150 if( rGL_GL.updated_k(0) )
151 o << setw(w) << rGL_GL.get_k(0).norm_inf();
156 if( quasi_newt_stats ) {
158 switch( quasi_newt_stats->
updated() ) {
192 o << setw(7) << act_stats->
num_adds();
201 else if( s.nu().updated_k(0) ) {
202 o << setw(7) << s.nu().get_k(0).nz()
214 << setw(3) << ( qp_stats->
warm_start() ?
'w' :
'c')
225 o << setw(w) << norm_2_Ypy;
230 o << setw(w) << norm_2_Zpz;
234 if( s.d().updated_k(0) )
236 << s.d().get_k(0).norm_inf();
240 if( s.alpha().updated_k(0) )
241 o << setw(w) << s.alpha().get_k(0);
255 const NLPObjGrad &nlp =
dyn_cast<
const NLPObjGrad>(_algo.nlp());
256 const NLPFirstOrder *nlp_foi =
dynamic_cast<const NLPFirstOrder*
>(&nlp);
261 std::ostream&
o = this->
o();
302 if( s.f().updated_k(0) )
303 o << setw(w) << s.f().get_k(0);
307 if( s.Gf().updated_k(0) )
308 o << setw(w) << s.Gf().get_k(0).norm_inf();
312 if( m && s.c().updated_k(0) )
314 << s.c().get_k(0).norm_inf();
319 const IterQuantityAccess<VectorMutable>
321 ? s.rGL() : s.GL() );
322 if( rGL_GL.updated_k(0) )
323 o << setw(w) << rGL_GL.get_k(0).norm_inf();
329 if( quasi_newt_stats ) {
330 switch( quasi_newt_stats->
updated() ) {
354 o << setw(w) <<
"-";;
362 else if( s.nu().updated_k(0) ) {
363 o << setw(7) << s.nu().get_k(0).nz()
375 << setw(3) << ( qp_stats->
warm_start() ?
'w' :
'c')
385 if(m && s.Ypy().updated_k(0))
387 << s.Ypy().get_k(0).norm_2();
391 if(s.Zpz().updated_k(0))
393 << s.Zpz().get_k(0).norm_2();
397 if( s.d().updated_k(0) )
399 << s.d().get_k(0).norm_inf();
405 o <<
"\nNumber of function evaluations:\n"
406 <<
"-------------------------------\n"
407 <<
"f(x) : " << nlp.num_f_evals() << endl
408 <<
"c(x) : " << ( m ? nlp.num_c_evals() : 0 ) << endl
409 <<
"Gf(x) : " << nlp.num_Gf_evals() << endl
413 o << nlp_foi->num_Gc_evals();
429 std::ostream&
o = this->
o();
431 NLPAlgoState::space_c_ptr_t
432 space_c = s.get_space_c();
434 o <<
"\n\n********************************\n"
435 <<
"*** Start of rSQP Iterations ***\n"
436 <<
"n = " << s.space_x().dim()
437 <<
", m = " << ( space_c.get() ? space_c->dim() : 0 )
441 if( s.Gc().updated_k(0) )
442 o << s.Gc().get_k(0).nz() << endl;
450 catch(
const AlgorithmState::DoesNotExist& ) {
492 <<
" ------------\n";
AbstractLinAlgPack::size_type size_type
void output_final(const Algorithm &algo, EAlgoReturn algo_return) const
Class for storing statistics about the Quasi-Newton updating.
void output_iteration(const Algorithm &algo) const
rSQP Algorithm control class.
act_set_stats_iq_member act_set_stats_
MoochoTrackerSummaryStd()
Class for storing statistics about the changes in the active set of an SQP algorithm.
const f_int f_dbl_prec const f_int f_int const f_int f_int const f_dbl_prec f_int f_int f_dbl_prec w[]
int infeasible_qp() const
T_To & dyn_cast(T_From &from)
Reduced space SQP state encapsulation interface.
Class for storing statistics about a run of a (active set?) QP solver.
AbstractLinAlgPack::value_type value_type
Acts as the central hub for an iterative algorithm.
NLPAlgoState & rsqp_state()
<<std aggr>="">> members for algo_cntr
qp_solver_stats_iq_member qp_solver_stats_
quasi_newton_stats_iq_member quasi_newton_stats_
void set_output_stream(const ostream_ptr_t &o)
Set the output stream for summary outputting.
const ostream_ptr_t & get_output_stream() const
Get the output stream for summary outputting.
void print_header(const NLPAlgoState &s) const
Print the header to the output.
NLPAlgo & rsqp_algo(Algorithm &algo)
Convert from a Algorithm to a NLPAlgo.
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)