60 #define min(a,b) ( (a < b) ? a : b )
61 #define max(a,b) ( (a > b) ? a : b )
63 namespace MoochoPack {
70 tau_boundary_frac_(tau_boundary_frac),
71 barrier_nlp_(barrier_nlp),
77 "PreProcessBarrierLineSearch_Step given NULL NLPBarrier."
96 NLP &nlp = algo.nlp();
108 const value_type& mu_k = s.barrier_parameter().get_k(0);
113 if ( s.barrier_parameter().updated_k(-1) )
115 const value_type mu_km1 = s.barrier_parameter().get_k(-1);
120 out <<
"\nBarrier Parameter changed - resetting the filter ...\n";
143 value_type& alpha_vl_k = s.alpha_vl().set_k(0);
144 value_type& alpha_vu_k = s.alpha_vu().set_k(0);
146 const Vector& x_k = s.x().get_k(0);
147 VectorMutable& x_kp1 = s.x().set_k(+1);
149 const Vector& d_k = s.d().get_k(0);
150 const Vector& dvl_k = s.dvl().get_k(0);
151 const Vector& dvu_k = s.dvu().get_k(0);
153 const Vector& vl_k = s.Vl().get_k(0).diag();
154 VectorMutable& vl_kp1 = s.Vl().set_k(+1).diag();
156 const Vector& vu_k = s.Vu().get_k(0).diag();
157 VectorMutable& vu_kp1 = s.Vu().set_k(+1).diag();
183 Vp_StV( &x_kp1, alpha_k, d_k);
185 alpha_vl_k = alpha_vu_k =
min(alpha_vl_k, alpha_vu_k);
188 Vp_StV( &vl_kp1, alpha_vl_k, dvl_k);
191 Vp_StV( &vu_kp1, alpha_vu_k, dvu_k);
194 IterQuantityAccess<VectorMutable>
195 *c_iq = nlp.m() > 0 ? &s.c() : NULL;
212 out <<
"\nalpha_vl_k = " << alpha_vl_k
213 <<
"\nalpha_vu_k = " << alpha_vu_k
214 <<
"\nalpha_k = " << alpha_k
218 if( static_cast<int>(olevel) >= static_cast<int>(
PRINT_VECTORS) )
220 out <<
"\nvl_kp1 = \n" << vl_kp1
221 <<
"\nvu_kp1 = \n" << vu_kp1
222 <<
"\nx_kp1 = \n" << x_kp1;
230 ,
poss_type assoc_step_poss, std::ostream&
out,
const std::string& L
235 out << L <<
"*** calculate alpha max by the fraction to boundary rule\n"
236 << L <<
"ToDo: Complete documentation\n";
241 const int local_num_options = 1;
248 const char* local_SOptions[local_num_options] =
258 ,
const char opt_grp_name[] )
260 OptionsFromStreamPack::SetOptionsFromStreamNode(
261 opt_grp_name, local_num_options, local_SOptions ),
271 case TAU_BOUNDARY_FRAC:
272 target().tau_boundary_frac(std::atof(option_value.c_str()));
void unset_quantities()
Call to unset all storage quantities (both in this class and all subclasses).
const std::string FILTER_IQ_STRING
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...
CastIQMember< Filter_T > filter_
void calc_f(const Vector &x, bool newx=true) const
Overloaded to include barrier term.
Fraction to boundary rule for calculating alpha max.
PreProcessBarrierLineSearch_StepSetOptions(PreProcessBarrierLineSearch_Step *target=0, const char opt_grp_name[]="PreProcessBarrierLineSearch")
#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.
Teuchos::RCP< NLPInterfacePack::NLPBarrier > barrier_nlp_
PreProcessBarrierLineSearch_Step & target()
std::list< FilterEntry > Filter_T
void mu(const value_type mu)
Set the barrier parameter.
bool do_step(Algorithm &algo, poss_type step_poss, IterationPack::EDoStepType type, poss_type assoc_step_poss)
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.
void set_c(VectorMutable *c)
AlgorithmTracker & track()
value_type fraction_to_boundary(const value_type tau, const Vector &x, const Vector &d, const Vector &xl, const Vector &xu)
value_type fraction_to_zero_boundary(const value_type tau, const Vector &x, const Vector &d)
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...
void calc_c(const Vector &x, bool newx=true) const
AbstractLinAlgPack::value_type value_type
Acts as the central hub for an iterative algorithm.
void setOption(int option_num, const std::string &option_value)
Overridden from SetOptionsFromStreamNode.
void set_Gf(VectorMutable *Gf)
void set_f(value_type *f)
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
PreProcessBarrierLineSearch_Step(Teuchos::RCP< NLPInterfacePack::NLPBarrier > barrier_nlp, const value_type tau_boundary_frac=0.99)
Constructor.
const std::string & option_value(OptionsGroup::const_iterator &itr)
void calc_Gf(const Vector &x, bool newx=true) const
Overloaded to include barrier term.