Class to organize all the data required by the algorithm. More...
#include <IpIpoptData.hpp>
Public Member Functions | |
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. | |
bool | Initialize (const Journalist &jnlst, const OptionsList &options, const std::string &prefix) |
This method must be called to initialize the global algorithmic parameters. | |
IPOPT_DEPRECATED Number | cpu_time_start () const |
Cpu time counter at the beginning of the optimization. | |
TimingStatistics & | TimingStats () |
Return Timing Statistics Object. | |
const TimingStatistics & | TimingStats () const |
Return Timing Statistics Object. | |
bool | HaveAddData () |
Check if additional data has been set. | |
IpoptAdditionalData & | AdditionalData () |
Get access to additional data object. | |
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. | |
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. | |
Constructors/Destructors | |
IpoptData (SmartPtr< IpoptAdditionalData > add_data=NULL) | |
Constructor. | |
virtual | ~IpoptData () |
Destructor. | |
Get Methods for Iterates | |
SmartPtr< const IteratesVector > | curr () const |
Current point. | |
SmartPtr< const IteratesVector > | trial () const |
Get the current point in a copied container that is non-const. | |
void | set_trial (SmartPtr< IteratesVector > &trial) |
Get Trial point in a copied container that is non-const. | |
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 | 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 provided step with step length alpha. | |
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 with step length alpha. | |
SmartPtr< const IteratesVector > | delta () const |
get the current delta | |
void | set_delta (SmartPtr< IteratesVector > &delta) |
Set the current delta. | |
void | set_delta (SmartPtr< const IteratesVector > &delta) |
Set the current delta. | |
SmartPtr< const IteratesVector > | delta_aff () const |
Affine Delta. | |
void | set_delta_aff (SmartPtr< IteratesVector > &delta_aff) |
Set the affine delta. | |
SmartPtr< const SymMatrix > | W () |
Hessian or Hessian approximation (do not hold on to it, it might be changed) | |
void | Set_W (SmartPtr< const SymMatrix > W) |
Set Hessian approximation. | |
("Main") Primal-dual search direction. | |
Those fields are used to store the search directions computed from solving the primal-dual system, and can be used in the line search. They are overwritten in every iteration, so do not hold on to the pointers (make copies instead) | |
bool | HaveDeltas () const |
Returns true, if the primal-dual step have been already computed for the current iteration. | |
void | SetHaveDeltas (bool have_deltas) |
Method for setting the HaveDeltas flag. | |
Public Methods for updating iterates | |
void | CopyTrialToCurrent () |
Copy the trial values to the current values. | |
void | AcceptTrialPoint () |
Set the current iterate values from the trial values. | |
General algorithmic data | |
Index | iter_count () const |
void | Set_iter_count (Index iter_count) |
Number | curr_mu () const |
void | Set_mu (Number mu) |
bool | MuInitialized () const |
Number | curr_tau () const |
void | Set_tau (Number tau) |
bool | TauInitialized () const |
void | SetFreeMuMode (bool free_mu_mode) |
bool | FreeMuMode () const |
void | Set_tiny_step_flag (bool flag) |
Setting the flag that indicates if a tiny step (below machine precision) has been detected. | |
bool | tiny_step_flag () |
Number | tol () const |
Overall convergence tolerance. | |
void | Set_tol (Number tol) |
Set a new value for the tolerance. | |
Information gathered for iteration output | |
Number | info_regu_x () const |
void | Set_info_regu_x (Number regu_x) |
Number | info_alpha_primal () const |
void | Set_info_alpha_primal (Number alpha_primal) |
char | info_alpha_primal_char () const |
void | Set_info_alpha_primal_char (char info_alpha_primal_char) |
Number | info_alpha_dual () const |
void | Set_info_alpha_dual (Number alpha_dual) |
Index | info_ls_count () const |
void | Set_info_ls_count (Index ls_count) |
bool | info_skip_output () const |
void | Append_info_string (const std::string &add_str) |
void | Append_info_string (const std::string &add_str, double value) |
const std::string & | info_string () const |
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 | info_last_output () |
gives time when the last summary output line was printed | |
void | Set_info_last_output (Number info_last_output) |
sets time when the last summary output line was printed | |
int | info_iters_since_header () |
gives number of iteration summaries actually printed since last summary header was printed | |
void | Inc_info_iters_since_header () |
increases number of iteration summaries actually printed since last summary header was printed | |
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 | ResetInfo () |
Reset all info fields. | |
Public Member Functions inherited from Ipopt::ReferencedObject | |
ReferencedObject () | |
virtual | ~ReferencedObject () |
Index | ReferenceCount () const |
void | AddRef (const Referencer *referencer) const |
void | ReleaseRef (const Referencer *referencer) const |
Static Public Member Functions | |
static void | RegisterOptions (const SmartPtr< RegisteredOptions > &roptions) |
Private Member Functions | |
Default Compiler Generated Methods | |
(Hidden to avoid implicit creation/calling). These methods are not implemented and we do not want the compiler to implement them for us, so we declare them private and do not define them. This ensures that they will not be implicitly created/called. | |
IpoptData (const IpoptData &) | |
Copy Constructor. | |
void | operator= (const IpoptData &) |
Default Assignment Operator. | |
Private Attributes | |
Index | iter_count_ |
iteration count | |
Number | curr_mu_ |
current barrier parameter | |
bool | mu_initialized_ |
Number | curr_tau_ |
current fraction to the boundary parameter | |
bool | tau_initialized_ |
bool | initialize_called_ |
flag indicating if Initialize method has been called (for debugging) | |
bool | have_prototypes_ |
flag for debugging whether we have already curr_ values available (from which new Vectors can be generated | |
SmartPtr< IteratesVectorSpace > | iterates_space_ |
VectorSpace for all the iterates. | |
TimingStatistics | timing_statistics_ |
TimingStatistics object collecting all Ipopt timing statistics. | |
SmartPtr< IpoptAdditionalData > | add_data_ |
Object for the data specific for the Chen-Goldfarb penalty method algorithm. | |
Iterates | |
SmartPtr< const IteratesVector > | curr_ |
Main iteration variables (current iteration) | |
SmartPtr< const IteratesVector > | trial_ |
Main iteration variables (trial calculations) | |
SmartPtr< const SymMatrix > | W_ |
Hessian (approximation) - might be changed elsewhere! | |
Primal-dual Step | |
SmartPtr< const IteratesVector > | delta_ |
bool | have_deltas_ |
The following flag is set to true, if some other part of the algorithm (like the method for computing the barrier parameter) has already computed the primal-dual search direction. | |
Global algorithm parameters. | |
Those are options that can be modified by the user and appear at different places in the algorithm. They are set using an OptionsList object in the Initialize method. | |
Number | tol_ |
Overall convergence tolerance. | |
Status data | |
bool | free_mu_mode_ |
flag indicating whether the algorithm is in the free mu mode | |
bool | tiny_step_flag_ |
flag indicating if a tiny step has been detected | |
Gathered information for iteration output | |
Number | info_regu_x_ |
Size of regularization for the Hessian. | |
Number | info_alpha_primal_ |
Primal step size. | |
char | info_alpha_primal_char_ |
Info character for primal step size. | |
Number | info_alpha_dual_ |
Dual step size. | |
Index | info_ls_count_ |
Number of backtracking trial steps. | |
bool | info_skip_output_ |
true, if next summary output line should not be printed (eg after restoration phase). | |
std::string | info_string_ |
any string of characters for the end of the output line | |
Number | info_last_output_ |
time when the last summary output line was printed | |
int | info_iters_since_header_ |
number of iteration summaries actually printed since last summary header was printed | |
Information about the perturbation of the primal-dual system | |
Number | pd_pert_x_ |
Number | pd_pert_s_ |
Number | pd_pert_c_ |
Number | pd_pert_d_ |
Affine-scaling step. | |
This used to transfer the information about the affine-scaling step from the computation of the barrier parameter to the corrector (in the line search). | |
SmartPtr< const IteratesVector > | delta_aff_ |
bool | have_affine_deltas_ |
The following flag is set to true, if some other part of the algorithm (like the method for computing the barrier parameter) has already computed the affine-scaling step. | |
bool | HaveAffineDeltas () const |
Returns true, if the affine-scaling step have been already computed for the current iteration. | |
void | SetHaveAffineDeltas (bool have_affine_deltas) |
Method for setting the HaveDeltas flag. | |
Class to organize all the data required by the algorithm.
Internally, once this Data object has been initialized, all internal curr_ vectors must always be set (so that prototypes are available). The current values can only be set from the trial values. The trial values can be set by copying from a vector or by adding some fraction of a step to the current values. This object also stores steps, which allows to easily communicate the step from the step computation object to the line search object.
Definition at line 100 of file IpIpoptData.hpp.
Ipopt::IpoptData::IpoptData | ( | SmartPtr< IpoptAdditionalData > | add_data = NULL | ) |
Constructor.
|
virtual |
Destructor.
bool Ipopt::IpoptData::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.
bool Ipopt::IpoptData::Initialize | ( | const Journalist & | jnlst, |
const OptionsList & | options, | ||
const std::string & | prefix | ||
) |
This method must be called to initialize the global algorithmic parameters.
The parameters are taken from the OptionsList object.
|
inline |
Current point.
Definition at line 835 of file IpIpoptData.hpp.
|
inline |
Get the current point in a copied container that is non-const.
The entries in the container cannot be modified, but the container can be modified to point to new entries. Get Trial point
Definition at line 842 of file IpIpoptData.hpp.
|
inline |
Get Trial point in a copied container that is non-const.
The entries in the container can not be modified, but the container can be modified to point to new entries. Set the trial point.
This method copies the pointer for efficiency (no copy and to keep cache tags the same) so after you call set you cannot modify the data again.
Definition at line 884 of file IpIpoptData.hpp.
void Ipopt::IpoptData::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 Ipopt::IpoptData::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 provided step with step length alpha.
void Ipopt::IpoptData::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 with step length alpha.
|
inline |
get the current delta
Definition at line 849 of file IpIpoptData.hpp.
|
inline |
Set the current delta.
Like the trial point, this method copies the pointer for efficiency (no copy and to keep cache tags the same) so after you call set, you cannot modify the data
Definition at line 909 of file IpIpoptData.hpp.
|
inline |
Set the current delta.
Like the trial point, this method copies the pointer for efficiency (no copy and to keep cache tags the same) so after you call set, you cannot modify the data. This is the version that is happy with a pointer to const IteratesVector.
Definition at line 932 of file IpIpoptData.hpp.
|
inline |
Affine Delta.
Definition at line 856 of file IpIpoptData.hpp.
|
inline |
Set the affine delta.
Like the trial point, this method copies the pointer for efficiency (no copy and to keep cache tags the same) so after you call set, you cannot modify the data
Definition at line 955 of file IpIpoptData.hpp.
Hessian or Hessian approximation (do not hold on to it, it might be changed)
Definition at line 242 of file IpIpoptData.hpp.
Set Hessian approximation.
Definition at line 248 of file IpIpoptData.hpp.
|
inline |
Returns true, if the primal-dual step have been already computed for the current iteration.
This flag is reset after every call of AcceptTrialPoint(). If the search direction is computed during the computation of the barrier parameter, the method computing the barrier parameter should call SetHaveDeltas(true) to tell the IpoptAlgorithm object that it doesn't need to recompute the primal-dual step.
Definition at line 274 of file IpIpoptData.hpp.
Method for setting the HaveDeltas flag.
This method should be called if some method computes the primal-dual step (and stores it in the delta_ fields of IpoptData) at an early part of the iteration. If that flag is set to true, the IpoptAlgorithm object will not recompute the step.
Definition at line 287 of file IpIpoptData.hpp.
|
inline |
Returns true, if the affine-scaling step have been already computed for the current iteration.
This flag is reset after every call of AcceptTrialPoint(). If the search direction is computed during the computation of the barrier parameter, the method computing the barrier parameter should call SetHaveDeltas(true) to tell the line search does not have to recompute them in case it wants to do a corrector step.
Definition at line 314 of file IpIpoptData.hpp.
Method for setting the HaveDeltas flag.
This method should be called if some method computes the primal-dual step (and stores it in the delta_ fields of IpoptData) at an early part of the iteration. If that flag is set to true, the IpoptAlgorithm object will not recompute the step.
Definition at line 327 of file IpIpoptData.hpp.
|
inline |
Copy the trial values to the current values.
Definition at line 864 of file IpIpoptData.hpp.
void Ipopt::IpoptData::AcceptTrialPoint | ( | ) |
Set the current iterate values from the trial values.
|
inline |
Definition at line 347 of file IpIpoptData.hpp.
Definition at line 351 of file IpIpoptData.hpp.
|
inline |
Definition at line 358 of file IpIpoptData.hpp.
Definition at line 363 of file IpIpoptData.hpp.
|
inline |
Definition at line 370 of file IpIpoptData.hpp.
|
inline |
Definition at line 375 of file IpIpoptData.hpp.
Definition at line 380 of file IpIpoptData.hpp.
|
inline |
Definition at line 387 of file IpIpoptData.hpp.
Definition at line 392 of file IpIpoptData.hpp.
|
inline |
Definition at line 398 of file IpIpoptData.hpp.
Setting the flag that indicates if a tiny step (below machine precision) has been detected.
Definition at line 406 of file IpIpoptData.hpp.
|
inline |
Definition at line 412 of file IpIpoptData.hpp.
|
inline |
Overall convergence tolerance.
It is used in the convergence test, but also in some other parts of the algorithm that depend on the specified tolerance, such as the minimum value for the barrier parameter. Obtain the tolerance.
Definition at line 427 of file IpIpoptData.hpp.
Set a new value for the tolerance.
One should be very careful when using this, since changing the predefined tolerance might have unexpected consequences. This method is for example used in the restoration convergence checker to tighten the restoration phase convergence tolerance, if the restoration phase converged to a point that has not a large value for the constraint violation.
Definition at line 442 of file IpIpoptData.hpp.
|
inline |
Cpu time counter at the beginning of the optimization.
This is useful to see how much CPU time has been spent in this optimization run.
Can only be called after beginning of optimization.
Definition at line 458 of file IpIpoptData.hpp.
|
inline |
Definition at line 465 of file IpIpoptData.hpp.
Definition at line 469 of file IpIpoptData.hpp.
|
inline |
Definition at line 475 of file IpIpoptData.hpp.
Definition at line 479 of file IpIpoptData.hpp.
|
inline |
Definition at line 485 of file IpIpoptData.hpp.
Definition at line 489 of file IpIpoptData.hpp.
|
inline |
Definition at line 495 of file IpIpoptData.hpp.
Definition at line 499 of file IpIpoptData.hpp.
|
inline |
Definition at line 505 of file IpIpoptData.hpp.
Definition at line 509 of file IpIpoptData.hpp.
|
inline |
Definition at line 515 of file IpIpoptData.hpp.
Definition at line 519 of file IpIpoptData.hpp.
Definition at line 526 of file IpIpoptData.hpp.
|
inline |
Definition at line 535 of file IpIpoptData.hpp.
Set this to true, if the next time when output is written, the summary line should not be printed.
Definition at line 542 of file IpIpoptData.hpp.
|
inline |
gives time when the last summary output line was printed
Definition at line 550 of file IpIpoptData.hpp.
sets time when the last summary output line was printed
Definition at line 555 of file IpIpoptData.hpp.
|
inline |
gives number of iteration summaries actually printed since last summary header was printed
Definition at line 565 of file IpIpoptData.hpp.
|
inline |
increases number of iteration summaries actually printed since last summary header was printed
Definition at line 572 of file IpIpoptData.hpp.
sets number of iteration summaries actually printed since last summary header was printed
Definition at line 579 of file IpIpoptData.hpp.
|
inline |
Reset all info fields.
Definition at line 587 of file IpIpoptData.hpp.
|
inline |
Return Timing Statistics Object.
Definition at line 599 of file IpIpoptData.hpp.
|
inline |
|
inline |
Check if additional data has been set.
Definition at line 614 of file IpIpoptData.hpp.
|
inline |
Get access to additional data object.
Definition at line 620 of file IpIpoptData.hpp.
|
inline |
Set a new pointer for additional Ipopt data.
Definition at line 626 of file IpIpoptData.hpp.
|
inline |
Set the perturbation of the primal-dual system.
Definition at line 636 of file IpIpoptData.hpp.
|
inline |
Get the current perturbation of the primal-dual system.
Definition at line 650 of file IpIpoptData.hpp.
|
static |
|
private |
Main iteration variables (current iteration)
Definition at line 671 of file IpIpoptData.hpp.
|
private |
Main iteration variables (trial calculations)
Definition at line 674 of file IpIpoptData.hpp.
Hessian (approximation) - might be changed elsewhere!
Definition at line 677 of file IpIpoptData.hpp.
|
private |
Definition at line 681 of file IpIpoptData.hpp.
|
private |
The following flag is set to true, if some other part of the algorithm (like the method for computing the barrier parameter) has already computed the primal-dual search direction.
This flag is reset when the AcceptTrialPoint method is called.
Definition at line 690 of file IpIpoptData.hpp.
|
private |
Definition at line 701 of file IpIpoptData.hpp.
|
private |
The following flag is set to true, if some other part of the algorithm (like the method for computing the barrier parameter) has already computed the affine-scaling step.
This flag is reset when the AcceptTrialPoint method is called.
Definition at line 709 of file IpIpoptData.hpp.
|
private |
iteration count
Definition at line 713 of file IpIpoptData.hpp.
|
private |
current barrier parameter
Definition at line 716 of file IpIpoptData.hpp.
|
private |
Definition at line 717 of file IpIpoptData.hpp.
|
private |
current fraction to the boundary parameter
Definition at line 720 of file IpIpoptData.hpp.
|
private |
Definition at line 721 of file IpIpoptData.hpp.
|
private |
flag indicating if Initialize method has been called (for debugging)
Definition at line 724 of file IpIpoptData.hpp.
|
private |
flag for debugging whether we have already curr_ values available (from which new Vectors can be generated
Definition at line 729 of file IpIpoptData.hpp.
|
private |
Overall convergence tolerance.
Definition at line 740 of file IpIpoptData.hpp.
|
private |
flag indicating whether the algorithm is in the free mu mode
Definition at line 746 of file IpIpoptData.hpp.
|
private |
flag indicating if a tiny step has been detected
Definition at line 748 of file IpIpoptData.hpp.
|
private |
Size of regularization for the Hessian.
Definition at line 754 of file IpIpoptData.hpp.
|
private |
Primal step size.
Definition at line 756 of file IpIpoptData.hpp.
|
private |
Info character for primal step size.
Definition at line 758 of file IpIpoptData.hpp.
|
private |
Dual step size.
Definition at line 760 of file IpIpoptData.hpp.
|
private |
Number of backtracking trial steps.
Definition at line 762 of file IpIpoptData.hpp.
|
private |
true, if next summary output line should not be printed (eg after restoration phase).
Definition at line 766 of file IpIpoptData.hpp.
|
private |
any string of characters for the end of the output line
Definition at line 768 of file IpIpoptData.hpp.
|
private |
time when the last summary output line was printed
Definition at line 770 of file IpIpoptData.hpp.
|
private |
number of iteration summaries actually printed since last summary header was printed
Definition at line 774 of file IpIpoptData.hpp.
|
private |
VectorSpace for all the iterates.
Definition at line 778 of file IpIpoptData.hpp.
|
private |
TimingStatistics object collecting all Ipopt timing statistics.
Definition at line 781 of file IpIpoptData.hpp.
|
private |
Object for the data specific for the Chen-Goldfarb penalty method algorithm.
Definition at line 786 of file IpIpoptData.hpp.
|
private |
Definition at line 790 of file IpIpoptData.hpp.
|
private |
Definition at line 791 of file IpIpoptData.hpp.
|
private |
Definition at line 792 of file IpIpoptData.hpp.
|
private |
Definition at line 793 of file IpIpoptData.hpp.