7#ifndef __IPIPOPTDATA_HPP__
8#define __IPIPOPTDATA_HPP__
54 const std::string& prefix
132 const std::string& prefix
291 have_deltas_ = have_deltas;
316 return have_affine_deltas_;
328 bool have_affine_deltas
331 have_affine_deltas_ = have_affine_deltas;
339 void CopyTrialToCurrent();
355 iter_count_ = iter_count;
368 mu_initialized_ =
true;
372 return mu_initialized_;
385 tau_initialized_ =
true;
389 return tau_initialized_;
396 free_mu_mode_ = free_mu_mode;
400 return free_mu_mode_;
410 tiny_step_flag_ = flag;
414 return tiny_step_flag_;
460 return timing_statistics_.OverallAlgorithm().StartCpuTime();
473 info_regu_x_ = regu_x;
477 return info_alpha_primal_;
483 info_alpha_primal_ = alpha_primal;
487 return info_alpha_primal_char_;
490 char info_alpha_primal_char
493 info_alpha_primal_char_ = info_alpha_primal_char;
497 return info_alpha_dual_;
503 info_alpha_dual_ = alpha_dual;
507 return info_ls_count_;
513 info_ls_count_ = ls_count;
517 return info_skip_output_;
520 const std::string& add_str
523 info_string_ += add_str;
527 const std::string& add_str,
531 std::ostringstream sstream;
532 sstream << add_str <<
'=' << std::setw(8) << std::setprecision(2) << std::scientific << value;
533 info_string_ += sstream.str();
543 bool info_skip_output
546 info_skip_output_ = info_skip_output;
552 return info_last_output_;
559 info_last_output_ = info_last_output;
567 return info_iters_since_header_;
574 info_iters_since_header_++;
580 int info_iters_since_header
583 info_iters_since_header_ = info_iters_since_header;
590 info_alpha_primal_ = 0;
591 info_alpha_dual_ = 0.;
592 info_alpha_primal_char_ =
' ';
593 info_skip_output_ =
false;
594 info_string_.erase();
601 return timing_statistics_;
610 return timing_statistics_;
632 add_data_ = add_data;
643 pd_pert_x_ = pd_pert_x;
644 pd_pert_s_ = pd_pert_s;
645 pd_pert_c_ = pd_pert_c;
646 pd_pert_d_ = pd_pert_d;
657 pd_pert_x = pd_pert_x_;
658 pd_pert_s = pd_pert_s_;
659 pd_pert_c = pd_pert_c_;
660 pd_pert_d = pd_pert_d_;
817#if IPOPT_CHECKLEVEL > 0
867#if IPOPT_CHECKLEVEL > 0
871 debug_curr_tag_ =
curr_->GetTag();
872 debug_curr_tag_sum_ =
curr_->GetTagSum();
877 debug_curr_tag_sum_ = 0;
890#if IPOPT_CHECKLEVEL > 0
895 debug_trial_tag_ =
trial->GetTag();
896 debug_trial_tag_sum_ =
trial->GetTagSum();
900 debug_trial_tag_ = 0;
901 debug_trial_tag_sum_ = 0;
914#if IPOPT_CHECKLEVEL > 0
918 debug_delta_tag_ =
delta->GetTag();
919 debug_delta_tag_sum_ =
delta->GetTagSum();
923 debug_delta_tag_ = 0;
924 debug_delta_tag_sum_ = 0;
937#if IPOPT_CHECKLEVEL > 0
941 debug_delta_tag_ =
delta->GetTag();
942 debug_delta_tag_sum_ =
delta->GetTagSum();
946 debug_delta_tag_ = 0;
947 debug_delta_tag_sum_ = 0;
960#if IPOPT_CHECKLEVEL > 0
964 debug_delta_aff_tag_ =
delta_aff->GetTag();
965 debug_delta_aff_tag_sum_ =
delta_aff->GetTagSum();
969 debug_delta_aff_tag_ = 0;
970 debug_delta_aff_tag_sum_ =
delta_aff->GetTagSum();
#define IPOPT_DEPRECATED
macro to declare symbols as deprecated
Base class for additional data that is special to a particular type of algorithm, such as the CG pena...
IpoptAdditionalData()
Default Constructor.
IpoptAdditionalData(const IpoptAdditionalData &)
Copy Constructor.
void operator=(const IpoptAdditionalData &)
Default Assignment Operator.
virtual bool Initialize(const Journalist &jnlst, const OptionsList &options, const std::string &prefix)=0
This method is called to initialize the global algorithmic parameters.
virtual bool InitializeDataStructures()=0
Initialize Data Structures at the beginning.
virtual ~IpoptAdditionalData()
Destructor.
virtual void AcceptTrialPoint()=0
Do whatever is necessary to accept a trial point as current iterate.
Class to organize all the data required by the algorithm.
TimingStatistics timing_statistics_
TimingStatistics object collecting all Ipopt timing statistics.
Number info_alpha_primal() const
Index info_ls_count_
Number of backtracking trial steps.
void operator=(const IpoptData &)
Default Assignment Operator.
bool HaveAddData()
Check if additional data has been set.
Number info_regu_x() const
std::string info_string_
any string of characters for the end of the output line
const std::string & info_string() const
void set_delta_aff(SmartPtr< IteratesVector > &delta_aff)
Set the affine delta.
void Append_info_string(const std::string &add_str)
void setPDPert(Number pd_pert_x, Number pd_pert_s, Number pd_pert_c, Number pd_pert_d)
Set the perturbation of the primal-dual system.
bool free_mu_mode_
flag indicating whether the algorithm is in the free mu mode
void Set_info_last_output(Number info_last_output)
sets time when the last summary output line was printed
SmartPtr< const SymMatrix > W()
Hessian or Hessian approximation (do not hold on to it, it might be changed)
void Set_info_regu_x(Number regu_x)
void Set_W(SmartPtr< const SymMatrix > W)
Set Hessian approximation.
SmartPtr< const IteratesVector > trial_
Main iteration variables (trial calculations)
SmartPtr< const IteratesVector > delta_aff_
void Inc_info_iters_since_header()
increases number of iteration summaries actually printed since last summary header was printed
bool have_deltas_
The following flag is set to true, if some other part of the algorithm (like the method for computing...
bool initialize_called_
flag indicating if Initialize method has been called (for debugging)
Index info_ls_count() const
void SetTrialEqMultipliersFromStep(Number alpha, const Vector &delta_y_c, const Vector &delta_y_d)
Set the values of the trial values for the equality constraint multipliers (y_c and y_d) from provide...
void SetHaveDeltas(bool have_deltas)
Method for setting the HaveDeltas flag.
int info_iters_since_header_
number of iteration summaries actually printed since last summary header was printed
TimingStatistics & TimingStats()
Return Timing Statistics Object.
bool HaveDeltas() const
Returns true, if the primal-dual step have been already computed for the current iteration.
Number info_alpha_dual_
Dual step size.
void Append_info_string(const std::string &add_str, double value)
SmartPtr< const IteratesVector > delta() const
get the current delta
void Set_info_ls_count(Index ls_count)
SmartPtr< IpoptAdditionalData > add_data_
Object for the data specific for the Chen-Goldfarb penalty method algorithm.
bool have_affine_deltas_
The following flag is set to true, if some other part of the algorithm (like the method for computing...
SmartPtr< const IteratesVector > curr_
Main iteration variables (current iteration)
IpoptAdditionalData & AdditionalData()
Get access to additional data object.
void SetTrialPrimalVariablesFromStep(Number alpha, const Vector &delta_x, const Vector &delta_s)
Set the values of the primal trial variables (x and s) from provided Step with step length alpha.
void AcceptTrialPoint()
Set the current iterate values from the trial values.
Number info_alpha_primal_
Primal step size.
void CopyTrialToCurrent()
Copy the trial values to the current values.
void Set_info_alpha_primal_char(char info_alpha_primal_char)
Number info_alpha_dual() const
IpoptData(const IpoptData &)
Copy Constructor.
void Set_tiny_step_flag(bool flag)
Setting the flag that indicates if a tiny step (below machine precision) has been detected.
SmartPtr< const IteratesVector > curr() const
Current point.
void Set_info_alpha_dual(Number alpha_dual)
void ResetInfo()
Reset all info fields.
void SetTrialBoundMultipliersFromStep(Number alpha, const Vector &delta_z_L, const Vector &delta_z_U, const Vector &delta_v_L, const Vector &delta_v_U)
Set the value of the trial values for the bound multipliers (z_L, z_U, v_L, v_U) from provided step w...
void Set_iter_count(Index iter_count)
Number curr_tau_
current fraction to the boundary parameter
SmartPtr< const IteratesVector > trial() const
Get the current point in a copied container that is non-const.
bool HaveAffineDeltas() const
Returns true, if the affine-scaling step have been already computed for the current iteration.
int info_iters_since_header()
gives number of iteration summaries actually printed since last summary header was printed
bool tiny_step_flag_
flag indicating if a tiny step has been detected
void Set_info_iters_since_header(int info_iters_since_header)
sets number of iteration summaries actually printed since last summary header was printed
SmartPtr< IteratesVectorSpace > iterates_space_
VectorSpace for all the iterates.
bool info_skip_output() const
Number tol_
Overall convergence tolerance.
Number curr_mu_
current barrier parameter
void Set_info_skip_output(bool info_skip_output)
Set this to true, if the next time when output is written, the summary line should not be printed.
Number tol() const
Overall convergence tolerance.
char info_alpha_primal_char_
Info character for primal step size.
bool have_prototypes_
flag for debugging whether we have already curr_ values available (from which new Vectors can be gene...
void Set_tol(Number tol)
Set a new value for the tolerance.
bool info_skip_output_
true, if next summary output line should not be printed (eg after restoration phase).
void SetFreeMuMode(bool free_mu_mode)
static void RegisterOptions(const SmartPtr< RegisteredOptions > &roptions)
IPOPT_DEPRECATED Number cpu_time_start() const
Cpu time counter at the beginning of the optimization.
virtual ~IpoptData()
Destructor.
bool InitializeDataStructures(IpoptNLP &ip_nlp, bool want_x, bool want_y_c, bool want_y_d, bool want_z_L, bool want_z_U)
Initialize Data Structures.
char info_alpha_primal_char() const
SmartPtr< const IteratesVector > delta_
bool Initialize(const Journalist &jnlst, const OptionsList &options, const std::string &prefix)
This method must be called to initialize the global algorithmic parameters.
Number info_last_output_
time when the last summary output line was printed
Index iter_count_
iteration count
Number info_last_output()
gives time when the last summary output line was printed
void set_delta(SmartPtr< IteratesVector > &delta)
Set the current delta.
SmartPtr< const SymMatrix > W_
Hessian (approximation) - might be changed elsewhere!
IpoptData(SmartPtr< IpoptAdditionalData > add_data=NULL)
Constructor.
bool MuInitialized() const
void SetHaveAffineDeltas(bool have_affine_deltas)
Method for setting the HaveDeltas flag.
void Set_info_alpha_primal(Number alpha_primal)
const TimingStatistics & TimingStats() const
Return Timing Statistics Object.
void set_trial(SmartPtr< IteratesVector > &trial)
Get Trial point in a copied container that is non-const.
void getPDPert(Number &pd_pert_x, Number &pd_pert_s, Number &pd_pert_c, Number &pd_pert_d)
Get the current perturbation of the primal-dual system.
bool TauInitialized() const
SmartPtr< const IteratesVector > delta_aff() const
Affine Delta.
Number info_regu_x_
Size of regularization for the Hessian.
void SetAddData(SmartPtr< IpoptAdditionalData > add_data)
Set a new pointer for additional Ipopt data.
This is the abstract base class for classes that map the traditional NLP into something that is more ...
Class responsible for all message output.
This class stores a list of user set options.
Storing the reference count of all the smart pointers that currently reference it.
Template class for Smart Pointers.
unsigned int Tag
Type for the Tag values.
This class collects all timing statistics for Ipopt.
VectorSpace base class, corresponding to the Vector base class.
This file contains a base class for all exceptions and a set of macros to help with exceptions.
SmartPtr< const U > ConstPtr(const SmartPtr< U > &smart_ptr)
bool IsValid(const SmartPtr< U > &smart_ptr)
U * GetRawPtr(const SmartPtr< U > &smart_ptr)
ipindex Index
Type of all indices of vectors, matrices etc.
ipnumber Number
Type of all numbers.
bool IsNull(const SmartPtr< U > &smart_ptr)