Ipopt  3.11.9
IpCGPerturbationHandler.hpp
Go to the documentation of this file.
1 // Copyright (C) 2005, 2008 International Business Machines and others.
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // $Id: IpCGPerturbationHandler.hpp 1861 2010-12-21 21:34:47Z andreasw $
6 //
7 // Authors: Carl Laird, Andreas Waechter IBM 2005-08-04
8 
9 #ifndef __IPCGPERTURBATIONHANDLER_HPP__
10 #define __IPCGPERTURBATIONHANDLER_HPP__
11 
13 #include "IpCGPenaltyCq.hpp"
14 
15 namespace Ipopt
16 {
17 
26  {
27  public:
34  {}
36 
37  /* overloaded from AlgorithmStrategyObject */
38  virtual bool InitializeImpl(const OptionsList& options,
39  const std::string& prefix);
40 
47  bool ConsiderNewSystem(Number& delta_x, Number& delta_s,
48  Number& delta_c, Number& delta_d);
49 
54  bool PerturbForSingularity(Number& delta_x, Number& delta_s,
55  Number& delta_c, Number& delta_d);
56 
61  bool PerturbForWrongInertia(Number& delta_x, Number& delta_s,
62  Number& delta_c, Number& delta_d);
63 
66  void CurrentPerturbation(Number& delta_x, Number& delta_s,
67  Number& delta_c, Number& delta_d);
68 
73 
74  private:
85 
89 
92  {
93  CGPenaltyData& cg_pen_data =
94  static_cast<CGPenaltyData&>(IpData().AdditionalData());
95  DBG_ASSERT(dynamic_cast<CGPenaltyData*>(&IpData().AdditionalData()));
96  return cg_pen_data;
97  }
98 
101  {
102  CGPenaltyCq& cg_pen_cq =
103  static_cast<CGPenaltyCq&>(IpCq().AdditionalCq());
104  DBG_ASSERT(dynamic_cast<CGPenaltyCq*>(&IpCq().AdditionalCq()));
105  return cg_pen_cq;
106  }
107 
119 
132 
136 
141  {
144  DEGENERATE
145  };
146 
150 
154 
159 
162  {
168  };
169 
173 
202 
207 
213  bool get_deltas_for_wrong_inertia(Number& delta_x, Number& delta_s,
214  Number& delta_c, Number& delta_d);
215 
223 
224  };
225 
226 } // namespace Ipopt
227 
228 #endif
#define DBG_ASSERT(test)
Definition: IpDebug.hpp:38
IpoptCalculatedQuantities & IpCq() const
Class for all Chen-Goldfarb penalty method specific calculated quantities.
Class to organize all the additional data required by the Chen-Goldfarb penalty function algorithm.
Class for handling the perturbation factors delta_x, delta_s, delta_c, and delta_d in the primal dual...
CGPerturbationHandler()
Default Constructor.
Number delta_x_curr_
The current value for delta_x.
virtual bool InitializeImpl(const OptionsList &options, const std::string &prefix)
Implementation of the initialization method that has to be overloaded by for each derived class.
Number mult_diverg_feasibility_tol_
Feasibility for perturbation in pure Newton method.
DegenType
Type for degeneracy flags.
Number delta_d_last_
The last nonzero value for delta_d.
Number delta_x_last_
The last nonzero value for delta_x.
Number delta_c_last_
The last nonzero value for delta_c.
bool get_deltas_for_wrong_inertia_called_
Flag indicating if for the given matrix the perturb for wrong inertia method has already been called.
Number delta_xs_inc_fact_
Increase factor for delta_xs for later perturbations.
Number delta_s_last_
The last nonzero value for delta_s.
DegenType jac_degenerate_
Flag indicating whether the Jacobian of the constraints is thought to be structurally rank-deficient.
void finalize_test()
This method is call whenever a matrix had been factorization and is not singular.
Index degen_iters_max_
Required number of iterations for degeneracy conclusions.
Number delta_c_curr_
The current value for delta_c.
Number delta_cd_exp_
Exponent on mu in formula for of perturbation for c and d blocks.
virtual ~CGPerturbationHandler()
Default destructor.
Number delta_xs_dec_fact_
Decrease factor for delta_xs for later perturbations.
void operator=(const CGPerturbationHandler &)
Overloaded Equals Operator.
Number delta_cd()
Compute perturbation value for constraints.
TrialStatus test_status_
Current status.
DegenType hess_degenerate_
Flag indicating whether the reduced Hessian matrix is thought to be structurally singular.
bool reset_last_
Flag indicating whether the new values are based on the perturbations in the last iteration or in the...
Number delta_d_curr_
The current value for delta_d.
bool PerturbForWrongInertia(Number &delta_x, Number &delta_s, Number &delta_c, Number &delta_d)
This method returns pertubation factors for the case when the most recent factorization resulted in a...
Index degen_iters_
Flag counting matrices in which degeneracy was observed in the first successive iterations.
Number delta_xs_first_inc_fact_
Increase factor for delta_xs for first required perturbation.
CGPerturbationHandler(const CGPerturbationHandler &)
Copy Constructor.
Number delta_xs_init_
Very first trial value for delta_xs perturbation.
Number delta_s_curr_
The current value for delta_s.
CGPenaltyData & CGPenData()
Method to easily access CGPenalty data.
Number delta_xs_min_
Smallest possible perturbation for x and s.
Number delta_xs_max_
Maximal perturbation for x and s.
bool ConsiderNewSystem(Number &delta_x, Number &delta_s, Number &delta_c, Number &delta_d)
This method must be called for each new matrix, and before any other method for generating perturbati...
CGPenaltyCq & CGPenCq()
Method to easily access CGPenalty calculated quantities.
Number delta_cd_val_
Size of perturbation for c and d blocks.
Number penalty_max_
The max reference value for scaling the penalty parameter.
bool PerturbForSingularity(Number &delta_x, Number &delta_s, Number &delta_c, Number &delta_d)
This method returns pertubation factors for the case when the most recent factorization resulted in a...
TrialStatus
Status of current trial configuration.
bool perturb_always_cd_
Flag indicating that the delta_c, delta_d perturbation should always be used.
bool get_deltas_for_wrong_inertia(Number &delta_x, Number &delta_s, Number &delta_c, Number &delta_d)
Internal version of PerturbForWrongInertia with the difference, that finalize_test is not called.
static void RegisterOptions(SmartPtr< RegisteredOptions > roptions)
Methods for IpoptType.
void CurrentPerturbation(Number &delta_x, Number &delta_s, Number &delta_c, Number &delta_d)
Just return the perturbation values that have been determined most recently.
IpoptAdditionalData & AdditionalData()
Get access to additional data object.
This class stores a list of user set options.
Class for handling the perturbation factors delta_x, delta_s, delta_c, and delta_d in the primal dual...
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:183
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:19
double Number
Type of all numbers.
Definition: IpTypes.hpp:17