56 namespace MoochoPack {
59 const bounds_tester_ptr_t& bounds_tester
62 bounds_tester_(bounds_tester)
75 NLP &nlp = algo.nlp();
90 IterQuantityAccess<value_type>
91 &alpha_iq = s.alpha();
92 if( !alpha_iq.updated_k(0) )
93 alpha_iq.set_k(0) = 1.0;
96 out <<
"\nf_k = " << s.f().get_k(0);
98 out <<
"\n||c_k||inf = " << s.c().get_k(0).norm_inf();
99 out <<
"\nalpha_k = " << alpha_iq.get_k(0) << std::endl;
103 IterQuantityAccess<VectorMutable> &x_iq = s.x();
104 const Vector &x_k = x_iq.get_k(0);
105 VectorMutable &x_kp1 = x_iq.set_k(+1);
107 Vp_StV( &x_kp1, alpha_iq.get_k(0), s.d().get_k(0) );
110 out <<
"\n||x_kp1||inf = " << s.x().get_k(+1).norm_inf() << std::endl;
112 if( static_cast<int>(olevel) >= static_cast<int>(
PRINT_VECTORS) ) {
113 out <<
"\nx_kp1 =\n" << s.x().get_k(+1);
116 if(algo.algo_cntr().check_results()) {
121 if( nlp.num_bounded_x() ) {
122 if(!bounds_tester().check_in_bounds(
133 ,
"LineSearchFullStep_Step::do_step(...) : Error, "
134 "the variables bounds xl <= x_k(+1) <= xu where violated!" );
140 nlp.unset_quantities();
141 nlp.set_f( &s.f().set_k(+1) );
142 if(m) nlp.set_c( &s.c().set_k(+1) );
144 if(m) nlp.calc_c( x_kp1,
false );
145 nlp.unset_quantities();
148 out <<
"\nf_kp1 = " << s.f().get_k(+1);
150 out <<
"\n||c_kp1||inf = " << s.c().get_k(+1).norm_inf();
154 if( m && static_cast<int>(olevel) >= static_cast<int>(
PRINT_VECTORS) ) {
155 out <<
"\nc_kp1 =\n" << s.c().get_k(+1);
158 if(algo.algo_cntr().check_results()) {
169 , std::ostream&
out,
const std::string& L )
const
172 << L <<
"if alpha_k is not updated then\n"
173 << L <<
" alpha_k = 1.0\n"
175 << L <<
"x_kp1 = x_k + alpha_k * d_k\n"
176 << L <<
"f_kp1 = f(x_kp1)\n"
177 << L <<
"if m > 0 then c_kp1 = c(x_kp1)\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
AbstractLinAlgPack::size_type size_type
Thrown if a runtime test failed.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
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...
bool do_step(Algorithm &algo, poss_type step_poss, IterationPack::EDoStepType type, poss_type assoc_step_poss)
EJournalOutputLevel
enum for journal output.
void V_VpV(VectorMutable *v_lhs, const V1 &V1_rhs1, const V2 &V2_rhs2)
Reduced space SQP state encapsulation interface.
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.
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.
NLPAlgoState & rsqp_state()
<<std aggr>="">> members for algo_cntr
LineSearchFullStep_Step()
Not defined and not to be called.
NLPAlgo & rsqp_algo(Algorithm &algo)
Convert from a Algorithm to a NLPAlgo.