Ipopt 3.12.10

- Main Page
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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
12 #include "IpPDPerturbationHandler.hpp"
13 #include "IpCGPenaltyCq.hpp"
14
15 namespace Ipopt
16 {
17
25 class CGPerturbationHandler: public PDPerturbationHandler
26 {
27 public:
31 CGPerturbationHandler();
33 virtual ~CGPerturbationHandler()
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
71 static void RegisterOptions(SmartPtr<RegisteredOptions> roptions);
73
74 private:
84 CGPerturbationHandler(const CGPerturbationHandler&);
85
87 void operator=(const CGPerturbationHandler&);
89
91 CGPenaltyData& CGPenData()
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
100 CGPenaltyCq& CGPenCq()
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
111 Number delta_x_last_;
113 Number delta_s_last_;
115 Number delta_c_last_;
117 Number delta_d_last_;
119
124 Number delta_x_curr_;
126 Number delta_s_curr_;
128 Number delta_c_curr_;
130 Number delta_d_curr_;
132
135 bool get_deltas_for_wrong_inertia_called_;
136
140 enum DegenType
141 {
142 NOT_YET_DETERMINED,
143 NOT_DEGENERATE,
144 DEGENERATE
145 };
146
149 DegenType hess_degenerate_;
150
153 DegenType jac_degenerate_;
154
158 Index degen_iters_;
159
161 enum TrialStatus
162 {
163 NO_TEST,
164 TEST_DELTA_C_EQ_0_DELTA_X_EQ_0,
165 TEST_DELTA_C_GT_0_DELTA_X_EQ_0,
166 TEST_DELTA_C_EQ_0_DELTA_X_GT_0,
167 TEST_DELTA_C_GT_0_DELTA_X_GT_0
168 };
169
171 TrialStatus test_status_;
173
177 Number delta_xs_max_;
179 Number delta_xs_min_;
181 Number delta_xs_first_inc_fact_;
183 Number delta_xs_inc_fact_;
185 Number delta_xs_dec_fact_;
187 Number delta_xs_init_;
189 Number delta_cd_val_;
191 Number delta_cd_exp_;
195 bool reset_last_;
197 Index degen_iters_max_;
200 bool perturb_always_cd_;
202
204 Number penalty_max_;
206 Number mult_diverg_feasibility_tol_;
207
213 bool get_deltas_for_wrong_inertia(Number& delta_x, Number& delta_s,
214 Number& delta_c, Number& delta_d);
215
219 void finalize_test();
221 Number delta_cd();
223
224 };
225
226 } // namespace Ipopt
227
228 #endif
Ipopt::CGPerturbationHandler::NOT_DEGENERATE
Definition: IpCGPerturbationHandler.hpp:143
Ipopt::CGPerturbationHandler
Class for handling the perturbation factors delta_x, delta_s, delta_c, and delta_d in the primal dual...
Definition: IpCGPerturbationHandler.hpp:25
Ipopt::CGPerturbationHandler::delta_cd_exp_
Number delta_cd_exp_
Exponent on mu in formula for of perturbation for c and d blocks.
Definition: IpCGPerturbationHandler.hpp:191
Ipopt::CGPerturbationHandler::CGPerturbationHandler
CGPerturbationHandler()
Default Constructor.
Ipopt::CGPerturbationHandler::delta_xs_inc_fact_
Number delta_xs_inc_fact_
Increase factor for delta_xs for later perturbations.
Definition: IpCGPerturbationHandler.hpp:183
Ipopt::CGPerturbationHandler::TrialStatus
TrialStatus
Status of current trial configuration.
Definition: IpCGPerturbationHandler.hpp:161
Ipopt::CGPerturbationHandler::PerturbForSingularity
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...
Ipopt::CGPerturbationHandler::delta_d_last_
Number delta_d_last_
The last nonzero value for delta_d.
Definition: IpCGPerturbationHandler.hpp:117
Ipopt::CGPerturbationHandler::TEST_DELTA_C_EQ_0_DELTA_X_EQ_0
Definition: IpCGPerturbationHandler.hpp:164
Ipopt::CGPerturbationHandler::DEGENERATE
Definition: IpCGPerturbationHandler.hpp:144
Ipopt::CGPerturbationHandler::degen_iters_max_
Index degen_iters_max_
Required number of iterations for degeneracy conclusions.
Definition: IpCGPerturbationHandler.hpp:197
Ipopt::Number
double Number
Type of all numbers.
Definition: IpTypes.hpp:17
Ipopt::CGPerturbationHandler::delta_d_curr_
Number delta_d_curr_
The current value for delta_d.
Definition: IpCGPerturbationHandler.hpp:130
Ipopt::CGPerturbationHandler::reset_last_
bool reset_last_
Flag indicating whether the new values are based on the perturbations in the last iteration or in the...
Definition: IpCGPerturbationHandler.hpp:195
Ipopt::CGPerturbationHandler::RegisterOptions
static void RegisterOptions(SmartPtr< RegisteredOptions > roptions)
Methods for IpoptType.
Ipopt::CGPerturbationHandler::delta_xs_first_inc_fact_
Number delta_xs_first_inc_fact_
Increase factor for delta_xs for first required perturbation.
Definition: IpCGPerturbationHandler.hpp:181
Ipopt::PDPerturbationHandler
Class for handling the perturbation factors delta_x, delta_s, delta_c, and delta_d in the primal dual...
Definition: IpPDPerturbationHandler.hpp:24
Ipopt::IpoptCalculatedQuantities::AdditionalCq
IpoptAdditionalCq & AdditionalCq()
Definition: IpIpoptCalculatedQuantities.hpp:452
Ipopt::CGPerturbationHandler::delta_s_last_
Number delta_s_last_
The last nonzero value for delta_s.
Definition: IpCGPerturbationHandler.hpp:113
Ipopt::CGPerturbationHandler::finalize_test
void finalize_test()
This method is call whenever a matrix had been factorization and is not singular. ...
IpCGPenaltyCq.hpp
Ipopt::CGPerturbationHandler::InitializeImpl
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...
Ipopt::SmartPtr
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:172
Ipopt::CGPerturbationHandler::mult_diverg_feasibility_tol_
Number mult_diverg_feasibility_tol_
Feasibility for perturbation in pure Newton method.
Definition: IpCGPerturbationHandler.hpp:206
Ipopt::CGPerturbationHandler::delta_x_last_
Number delta_x_last_
The last nonzero value for delta_x.
Definition: IpCGPerturbationHandler.hpp:111
Ipopt::OptionsList
This class stores a list of user set options.
Definition: IpOptionsList.hpp:32
Ipopt::CGPerturbationHandler::penalty_max_
Number penalty_max_
The max reference value for scaling the penalty parameter.
Definition: IpCGPerturbationHandler.hpp:204
Ipopt::CGPenaltyData
Class to organize all the additional data required by the Chen-Goldfarb penalty function algorithm...
Definition: IpCGPenaltyData.hpp:22
Ipopt::CGPerturbationHandler::ConsiderNewSystem
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...
Ipopt::CGPerturbationHandler::delta_xs_min_
Number delta_xs_min_
Smallest possible perturbation for x and s.
Definition: IpCGPerturbationHandler.hpp:179
Ipopt::CGPerturbationHandler::CGPenCq
CGPenaltyCq & CGPenCq()
Method to easily access CGPenalty calculated quantities.
Definition: IpCGPerturbationHandler.hpp:100
Ipopt::CGPerturbationHandler::delta_x_curr_
Number delta_x_curr_
The current value for delta_x.
Definition: IpCGPerturbationHandler.hpp:124
Ipopt::CGPenaltyCq
Class for all Chen-Goldfarb penalty method specific calculated quantities.
Definition: IpCGPenaltyCq.hpp:22
Ipopt::IpoptData::AdditionalData
IpoptAdditionalData & AdditionalData()
Get access to additional data object.
Definition: IpIpoptData.hpp:502
Ipopt::CGPerturbationHandler::TEST_DELTA_C_GT_0_DELTA_X_EQ_0
Definition: IpCGPerturbationHandler.hpp:165
Ipopt::CGPerturbationHandler::perturb_always_cd_
bool perturb_always_cd_
Flag indicating that the delta_c, delta_d perturbation should always be used.
Definition: IpCGPerturbationHandler.hpp:200
Ipopt::CGPerturbationHandler::jac_degenerate_
DegenType jac_degenerate_
Flag indicating whether the Jacobian of the constraints is thought to be structurally rank-deficient...
Definition: IpCGPerturbationHandler.hpp:153
Ipopt::Index
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:19
Ipopt::CGPerturbationHandler::operator=
void operator=(const CGPerturbationHandler &)
Overloaded Equals Operator.
Ipopt::CGPerturbationHandler::TEST_DELTA_C_EQ_0_DELTA_X_GT_0
Definition: IpCGPerturbationHandler.hpp:166
DBG_ASSERT
#define DBG_ASSERT(test)
Definition: IpDebug.hpp:38
Ipopt::CGPerturbationHandler::NOT_YET_DETERMINED
Definition: IpCGPerturbationHandler.hpp:142
Ipopt::CGPerturbationHandler::CGPenData
CGPenaltyData & CGPenData()
Method to easily access CGPenalty data.
Definition: IpCGPerturbationHandler.hpp:91
Ipopt::CGPerturbationHandler::get_deltas_for_wrong_inertia
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...
Ipopt::CGPerturbationHandler::TEST_DELTA_C_GT_0_DELTA_X_GT_0
Definition: IpCGPerturbationHandler.hpp:167
Ipopt::AlgorithmStrategyObject::IpData
IpoptData & IpData() const
Definition: IpAlgStrategy.hpp:131
Ipopt::CGPerturbationHandler::delta_cd_val_
Number delta_cd_val_
Size of perturbation for c and d blocks.
Definition: IpCGPerturbationHandler.hpp:189
Ipopt::CGPerturbationHandler::delta_s_curr_
Number delta_s_curr_
The current value for delta_s.
Definition: IpCGPerturbationHandler.hpp:126
Ipopt::CGPerturbationHandler::hess_degenerate_
DegenType hess_degenerate_
Flag indicating whether the reduced Hessian matrix is thought to be structurally singular.
Definition: IpCGPerturbationHandler.hpp:149
Ipopt::CGPerturbationHandler::delta_xs_dec_fact_
Number delta_xs_dec_fact_
Decrease factor for delta_xs for later perturbations.
Definition: IpCGPerturbationHandler.hpp:185
Ipopt::CGPerturbationHandler::PerturbForWrongInertia
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...
Ipopt::AlgorithmStrategyObject::IpCq
IpoptCalculatedQuantities & IpCq() const
Definition: IpAlgStrategy.hpp:137
Ipopt::CGPerturbationHandler::test_status_
TrialStatus test_status_
Current status.
Definition: IpCGPerturbationHandler.hpp:171
Ipopt::CGPerturbationHandler::delta_xs_max_
Number delta_xs_max_
Maximal perturbation for x and s.
Definition: IpCGPerturbationHandler.hpp:177
Ipopt::CGPerturbationHandler::get_deltas_for_wrong_inertia_called_
bool get_deltas_for_wrong_inertia_called_
Flag indicating if for the given matrix the perturb for wrong inertia method has already been called...
Definition: IpCGPerturbationHandler.hpp:135
Ipopt::CGPerturbationHandler::delta_xs_init_
Number delta_xs_init_
Very first trial value for delta_xs perturbation.
Definition: IpCGPerturbationHandler.hpp:187
Ipopt::CGPerturbationHandler::NO_TEST
Definition: IpCGPerturbationHandler.hpp:163
Ipopt::CGPerturbationHandler::~CGPerturbationHandler
virtual ~CGPerturbationHandler()
Default destructor.
Definition: IpCGPerturbationHandler.hpp:33
Ipopt::CGPerturbationHandler::delta_cd
Number delta_cd()
Compute perturbation value for constraints.
Ipopt::CGPerturbationHandler::degen_iters_
Index degen_iters_
Flag counting matrices in which degeneracy was observed in the first successive iterations.
Definition: IpCGPerturbationHandler.hpp:158
Ipopt::CGPerturbationHandler::DegenType
DegenType
Type for degeneracy flags.
Definition: IpCGPerturbationHandler.hpp:140
Ipopt::CGPerturbationHandler::delta_c_curr_
Number delta_c_curr_
The current value for delta_c.
Definition: IpCGPerturbationHandler.hpp:128
Ipopt::CGPerturbationHandler::delta_c_last_
Number delta_c_last_
The last nonzero value for delta_c.
Definition: IpCGPerturbationHandler.hpp:115
Ipopt::CGPerturbationHandler::CurrentPerturbation
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.
IpPDPerturbationHandler.hpp