7 #ifndef __IPIPOPTDATA_HPP__ 8 #define __IPIPOPTDATA_HPP__ 48 virtual bool Initialize(
51 const std::string& prefix
55 virtual bool InitializeDataStructures() = 0;
62 virtual void AcceptTrialPoint() = 0;
112 bool InitializeDataStructures(
129 const std::string& prefix
171 void SetTrialPrimalVariablesFromStep(
180 void SetTrialEqMultipliersFromStep(
189 void SetTrialBoundMultipliersFromStep(
289 have_deltas_ = have_deltas;
314 return have_affine_deltas_;
326 bool have_affine_deltas
329 have_affine_deltas_ = have_affine_deltas;
337 void CopyTrialToCurrent();
340 void AcceptTrialPoint();
344 Index iter_count()
const 353 iter_count_ = iter_count;
366 mu_initialized_ =
true;
370 return mu_initialized_;
383 tau_initialized_ =
true;
387 return tau_initialized_;
394 free_mu_mode_ = free_mu_mode;
398 return free_mu_mode_;
408 tiny_step_flag_ = flag;
412 return tiny_step_flag_;
458 return timing_statistics_.OverallAlgorithm().StartCpuTime();
462 Number info_regu_x()
const 471 info_regu_x_ = regu_x;
475 return info_alpha_primal_;
481 info_alpha_primal_ = alpha_primal;
485 return info_alpha_primal_char_;
488 char info_alpha_primal_char
491 info_alpha_primal_char_ = info_alpha_primal_char;
495 return info_alpha_dual_;
501 info_alpha_dual_ = alpha_dual;
505 return info_ls_count_;
511 info_ls_count_ = ls_count;
515 return info_skip_output_;
518 const std::string& add_str
521 info_string_ += add_str;
531 bool info_skip_output
534 info_skip_output_ = info_skip_output;
540 return info_last_output_;
547 info_last_output_ = info_last_output;
555 return info_iters_since_header_;
562 info_iters_since_header_++;
568 int info_iters_since_header
571 info_iters_since_header_ = info_iters_since_header;
578 info_alpha_primal_ = 0;
579 info_alpha_dual_ = 0.;
580 info_alpha_primal_char_ =
' ';
581 info_skip_output_ =
false;
582 info_string_.erase();
589 return timing_statistics_;
611 add_data_ = add_data;
622 pd_pert_x_ = pd_pert_x;
623 pd_pert_s_ = pd_pert_s;
624 pd_pert_c_ = pd_pert_c;
625 pd_pert_d_ = pd_pert_d;
636 pd_pert_x = pd_pert_x_;
637 pd_pert_s = pd_pert_s_;
638 pd_pert_c = pd_pert_c_;
639 pd_pert_d = pd_pert_d_;
642 static void RegisterOptions(
796 #if IPOPT_CHECKLEVEL > 0 846 #if IPOPT_CHECKLEVEL > 0 850 debug_curr_tag_ =
curr_->GetTag();
851 debug_curr_tag_sum_ =
curr_->GetTagSum();
856 debug_curr_tag_sum_ = 0;
869 #if IPOPT_CHECKLEVEL > 0 874 debug_trial_tag_ =
trial->GetTag();
875 debug_trial_tag_sum_ =
trial->GetTagSum();
879 debug_trial_tag_ = 0;
880 debug_trial_tag_sum_ = 0;
893 #if IPOPT_CHECKLEVEL > 0 897 debug_delta_tag_ =
delta->GetTag();
898 debug_delta_tag_sum_ =
delta->GetTagSum();
902 debug_delta_tag_ = 0;
903 debug_delta_tag_sum_ = 0;
916 #if IPOPT_CHECKLEVEL > 0 920 debug_delta_tag_ =
delta->GetTag();
921 debug_delta_tag_sum_ =
delta->GetTagSum();
925 debug_delta_tag_ = 0;
926 debug_delta_tag_sum_ = 0;
939 #if IPOPT_CHECKLEVEL > 0 943 debug_delta_aff_tag_ =
delta_aff->GetTag();
944 debug_delta_aff_tag_sum_ =
delta_aff->GetTagSum();
948 debug_delta_aff_tag_ = 0;
949 debug_delta_aff_tag_sum_ =
delta_aff->GetTagSum();
bool IsValid(const SmartPtr< U > &smart_ptr)
void Set_info_regu_x(Number regu_x)
void set_delta(SmartPtr< IteratesVector > &delta)
Set the current delta.
Number info_regu_x_
Size of regularization for the Hessian.
int info_iters_since_header_
number of iteration summaries actually printed since last summary header was printed ...
void Append_info_string(const std::string &add_str)
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.
Number curr_tau_
current fraction to the boundary parameter
Number info_last_output()
gives time when the last summary output line was printed
void SetHaveAffineDeltas(bool have_affine_deltas)
Method for setting the HaveDeltas flag.
Number curr_mu_
current barrier parameter
SmartPtr< IpoptAdditionalData > add_data_
Object for the data specific for the Chen-Goldfarb penalty method algorithm.
void ResetInfo()
Reset all info fields.
void Set_info_alpha_dual(Number alpha_dual)
IPOPT_DEPRECATED Number cpu_time_start() const
Cpu time counter at the beginning of the optimization.
void set_delta_aff(SmartPtr< IteratesVector > &delta_aff)
Set the affine delta.
bool HaveDeltas() const
Returns true, if the primal-dual step have been already computed for the current iteration.
IpoptAdditionalData()
Default Constructor.
void Set_info_ls_count(Index ls_count)
TimingStatistics timing_statistics_
TimingStatistics object collecting all Ipopt timing statistics.
bool info_skip_output() const
void Set_tiny_step_flag(bool flag)
Setting the flag that indicates if a tiny step (below machine precision) has been detected...
bool IsNull(const SmartPtr< U > &smart_ptr)
void Set_info_last_output(Number info_last_output)
sets time when the last summary output line was printed
void Set_iter_count(Index iter_count)
int info_iters_since_header()
gives number of iteration summaries actually printed since last summary header was printed ...
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...
Number info_last_output_
time when the last summary output line was printed
void Set_info_alpha_primal_char(char info_alpha_primal_char)
SmartPtr< const SymMatrix > W()
Hessian or Hessian approximation (do not hold on to it, it might be changed)
void SetFreeMuMode(bool free_mu_mode)
bool HaveAddData()
Check if additional data has been set.
void Set_W(SmartPtr< const SymMatrix > W)
Set Hessian approximation.
Number info_alpha_primal_
Primal step size.
ipindex Index
Type of all indices of vectors, matrices etc.
This file contains a base class for all exceptions and a set of macros to help with exceptions...
TimingStatistics & TimingStats()
Return Timing Statistics Object.
SmartPtr< const IteratesVector > curr_
Main iteration variables (current iteration)
This class collects all timing statistics for Ipopt.
std::string info_string_
any string of characters for the end of the output line
Template class for Smart Pointers.
Storing the reference count of all the smart pointers that currently reference it.
This class stores a list of user set options.
bool info_skip_output_
true, if next summary output line should not be printed (eg after restoration phase).
VectorSpace base class, corresponding to the Vector base class.
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 > delta_aff_
U * GetRawPtr(const SmartPtr< U > &smart_ptr)
SmartPtr< const IteratesVector > delta() const
get the current delta
char info_alpha_primal_char() const
Number tol_
Overall convergence tolerance.
SmartPtr< const IteratesVector > delta_
virtual ~IpoptAdditionalData()
Destructor.
bool have_prototypes_
flag for debugging whether we have already curr_ values available (from which new Vectors can be gene...
void Inc_info_iters_since_header()
increases number of iteration summaries actually printed since last summary header was printed ...
IpoptAdditionalData & AdditionalData()
Get access to additional data object.
Class to organize all the data required by the algorithm.
ipnumber Number
Type of all numbers.
const std::string & info_string() const
Number info_alpha_dual() const
Number info_alpha_dual_
Dual step size.
bool tiny_step_flag_
flag indicating if a tiny step has been detected
void SetHaveDeltas(bool have_deltas)
Method for setting the HaveDeltas flag.
SmartPtr< const IteratesVector > delta_aff() const
Affine Delta.
SmartPtr< IteratesVectorSpace > iterates_space_
VectorSpace for all the iterates.
unsigned int Tag
Type for the Tag values.
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...
SmartPtr< const U > ConstPtr(const SmartPtr< U > &smart_ptr)
Index iter_count_
iteration count
bool MuInitialized() const
void Set_info_iters_since_header(int info_iters_since_header)
sets number of iteration summaries actually printed since last summary header was printed ...
void Set_tol(Number tol)
Set a new value for the tolerance.
Class responsible for all message output.
bool TauInitialized() const
bool free_mu_mode_
flag indicating whether the algorithm is in the free mu mode
char info_alpha_primal_char_
Info character for primal step size.
SmartPtr< const SymMatrix > W_
Hessian (approximation) - might be changed elsewhere!
Index info_ls_count() const
bool initialize_called_
flag indicating if Initialize method has been called (for debugging)
void SetAddData(SmartPtr< IpoptAdditionalData > add_data)
Set a new pointer for additional Ipopt data.
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.
This is the abstract base class for classes that map the traditional NLP into something that is more ...
Number info_alpha_primal() const
SmartPtr< const IteratesVector > curr() const
Current point.
#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...
bool have_deltas_
The following flag is set to true, if some other part of the algorithm (like the method for computing...
Number tol() const
Overall convergence tolerance.
void Set_info_alpha_primal(Number alpha_primal)
void set_trial(SmartPtr< IteratesVector > &trial)
Get Trial point in a copied container that is non-const.
void CopyTrialToCurrent()
Copy the trial values to the current values.
SmartPtr< const IteratesVector > trial_
Main iteration variables (trial calculations)
Index info_ls_count_
Number of backtracking trial steps.