61 namespace MoochoPack {
68 relative_bound_push_(relative_bound_push),
69 absolute_bound_push_(absolute_bound_push)
83 NLP &nlp = algo.nlp();
84 NLPFirstOrder *nlp_foi =
dynamic_cast<NLPFirstOrder*
>(&nlp);
89 if(!nlp.is_initialized())
90 nlp.initialize(algo.algo_cntr().check_results());
99 IterQuantityAccess<value_type> &barrier_parameter_iq = s.barrier_parameter();
100 IterQuantityAccess<VectorMutable> &x_iq = s.x();
102 if( x_iq.last_updated() == IterQuantity::NONE_UPDATED )
106 out <<
"\nInitialize x with x_k = nlp.xinit() ...\n"
107 <<
" and push x_k within bounds.\n";
109 VectorMutable& x_k = x_iq.set_k(0) = nlp.xinit();
113 absolute_bound_push_,
119 IterQuantityAccess<value_type>
121 IterQuantityAccess<VectorMutable>
123 *c_iq = nlp.m() > 0 ? &s.c() : NULL;
124 IterQuantityAccess<MatrixOp>
125 *Gc_iq = nlp_foi ? &s.Gc() : NULL;
131 if(f_iq.updated_k(0))
132 f_iq.set_not_updated_k(0);
133 if(Gf_iq.updated_k(0))
134 Gf_iq.set_not_updated_k(0);
137 if(c_iq->updated_k(0))
138 c_iq->set_not_updated_k(0);
142 if(Gc_iq->updated_k(0))
143 Gc_iq->set_not_updated_k(0);
147 if (barrier_parameter_iq.last_updated() == IterQuantity::NONE_UPDATED)
149 barrier_parameter_iq.set_k(-1) = 0.1;
153 if( static_cast<int>(olevel) >= static_cast<int>(
PRINT_VECTORS) )
155 out <<
"x_k =\n" << x_iq.get_k(0);
164 ,
poss_type assoc_step_poss, std::ostream&
out,
const std::string& L
169 out << L <<
"# Evaluate information specific to primal / dual barrier algorithms\n"
170 << L <<
"if (x never updated) then\n"
171 << L <<
" x_k = nlp.xinit()\n"
172 << L <<
" force_in_bounds(x_k)\n"
173 << L <<
" set f_k not updated\n"
174 << L <<
" set Gf_k not updated\n"
175 << L <<
" if (m > 0) then\n"
176 << L <<
" set c_k not updated\n"
177 << L <<
" set Gc_k not updated\n"
184 const int local_num_options = 2;
192 const char* local_SOptions[local_num_options] =
194 "relative_bound_push",
195 "absolute_bound_push"
203 ,
const char opt_grp_name[] )
205 OptionsFromStreamPack::SetOptionsFromStreamNode(
206 opt_grp_name, local_num_options, local_SOptions ),
219 case RELATIVE_BOUND_PUSH:
220 target().relative_bound_push(std::atof(option_value.c_str()));
222 case ABSOLUTE_BOUND_PUSH:
223 target().absolute_bound_push(std::atof(option_value.c_str()));
bool StringToBool(const char *opt_name, const char *str)
Convert a string "true" or "false" into bool #true# or #false#.
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...
PreEvalNewPointBarrier_Step(const value_type relative_bound_push=0.01, const value_type absolute_bound_push=0.001)
void force_in_bounds_buffer(const value_type rel_push, const value_type abs_push, const Vector &xl, const Vector &xu, VectorMutable *x)
Force a vector sufficiently within bounds according to a specified absolute and relative buffer...
rSQP Algorithm control class.
PreEvalNewPointBarrier_Step & target()
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.
bool do_step(Algorithm &algo, poss_type step_poss, IterationPack::EDoStepType type, poss_type assoc_step_poss)
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.
AlgorithmTracker & track()
PreEvalNewPointBarrier_StepSetOptions(PreEvalNewPointBarrier_Step *target=0, const char opt_grp_name[]="PreEvalNewPointBarrier")
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...
AbstractLinAlgPack::value_type value_type
Acts as the central hub for an iterative algorithm.
Standard evaluation step class for extra parameters in primal/dual barrier method.
void setOption(int option_num, const std::string &option_value)
Overridden from SetOptionsFromStreamNode.
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
const std::string & option_value(OptionsGroup::const_iterator &itr)