Ipopt Documentation  
 
Loading...
Searching...
No Matches
IpCGPenaltyData.hpp
Go to the documentation of this file.
1// Copyright (C) 2007, 2008 International Business Machines and others.
2// All Rights Reserved.
3// This code is published under the Eclipse Public License.
4//
5// Authors: Andreas Waechter IBM 2007-06-04
6// based on IpIpoptData.hpp
7
8#ifndef __IPCGPENALTYDATA_HPP__
9#define __IPCGPENALTYDATA_HPP__
10
11#include "IpIteratesVector.hpp"
12#include "IpOptionsList.hpp"
13#include "IpIpoptData.hpp"
14
15namespace Ipopt
16{
17
22{
23public:
26
28
32
39 const Journalist& jnlst,
40 const OptionsList& options,
41 const std::string& prefix);
42
45
48
55 void set_delta_cgpen(
57 );
58
67 void set_delta_cgpen(
69 );
70
73
82 );
83
90 bool HaveCgPenDeltas() const
91 {
92 return have_cgpen_deltas_;
93 }
94
101
102 bool HaveCgFastDeltas() const
103 {
104 return have_cgfast_deltas_;
105 }
106
114
117
120
122 {
123 return curr_penalty_pert_;
124 }
125
131
138
143
145 {
146 return restor_iter_;
147 }
148
151 )
152 {
154 }
155
157 {
158 return restor_counter_;
159 }
160
167
170 )
171 {
173 }
174
176 {
177 return max_alpha_x_;
178 }
179
181 {
183 return curr_penalty_;
184 }
185
188 )
189 {
192 }
193
195 {
196 penalty_initialized_ = false;
197 }
198
200 {
202 }
203
209
217
222
224 {
226 }
227
228private:
229
238
243 // ToDo we could cue off of a null delta_cgpen_
246
255
261 // ToDo we could cue off of a null delta_cgfast_
264
267
269
273
282
285
296
298 const CGPenaltyData&
299 );
300
303 const CGPenaltyData&
304 );
306
307#if IPOPT_CHECKLEVEL > 0
317#endif
318
319};
320
327
334
335inline
337 SmartPtr<IteratesVector>& delta_cgpen
338)
339{
341#if IPOPT_CHECKLEVEL > 0
342
343 if (IsValid(delta_cgpen))
344 {
347 }
348 else
349 {
352 }
353#endif
354
356}
357
358inline
361)
362{
364#if IPOPT_CHECKLEVEL > 0
365
366 if (IsValid(delta_cgpen))
367 {
370 }
371 else
372 {
375 }
376#endif
377
379}
380
381inline
383 SmartPtr<IteratesVector>& delta_cgfast
384)
385{
387#if IPOPT_CHECKLEVEL > 0
388
390 {
393 }
394 else
395 {
398 }
399#endif
400
402}
403
404} // namespace Ipopt
405
406#endif
#define DBG_ASSERT(test)
Definition IpDebug.hpp:27
Class to organize all the additional data required by the Chen-Goldfarb penalty function algorithm.
void SetHaveCgPenDeltas(bool have_cgpen_deltas)
bool InitializeDataStructures()
Initialize Data Structures.
~CGPenaltyData()
Destructor.
SmartPtr< const IteratesVector > delta_cgfast_
void set_delta_cgpen(SmartPtr< IteratesVector > &delta_pen)
Set the delta_cgpen.
SmartPtr< const IteratesVector > delta_cgpen() const
Delta for the Chen-Goldfarb search direction.
CGPenaltyData()
Constructor.
void Set_kkt_penalty(Number kkt_penalty)
bool never_try_pure_Newton_
Flag indicating whether the pure Newton method is used.
bool KKTPenaltyInitialized() const
bool PenaltyInitialized() const
void Set_penalty(Number penalty)
void SetNeverTryPureNewton(bool never_try_pure_Newton)
CGPenaltyData(const CGPenaltyData &)
Copy Constructor.
SmartPtr< const IteratesVector > delta_cgpen_
void SetCurrPenaltyPert(Number curr_penalty_pert)
void SetRestorCounter(Number restor_counter)
Index restor_iter_
The iteration at which pure Newton method is given up.
void AcceptTrialPoint()
Set the current iterate values from the trial values.
void SetPrimalStepSize(Number max_alpha_x)
bool have_cgpen_deltas_
The following flag is set to true, if some other part of the algorithm has already computed the Chen-...
Number curr_penalty() const
bool Initialize(const Journalist &jnlst, const OptionsList &options, const std::string &prefix)
This method must be called to initialize the global algorithmic parameters.
bool have_cgfast_deltas_
The following flag is set to true, if some other part of the algorithm has already computed the fast ...
void SetRestorIter(Index restor_iter)
SmartPtr< const IteratesVector > delta_cgfast() const
Delta for the fast Chen-Goldfarb search direction.
bool initialize_called_
flag indicating if Initialize method has been called (for debugging)
void SetHaveCgFastDeltas(bool have_cgfast_deltas)
Number curr_kkt_penalty() const
void operator=(const CGPenaltyData &)
Default Assignment Operator.
void set_delta_cgfast(SmartPtr< IteratesVector > &delta_fast)
Set the delta_cgfast.
Templated class which stores one entry for the CachedResult class.
Base class for additional data that is special to a particular type of algorithm, such as the CG pena...
Class responsible for all message output.
This class stores a list of user set options.
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)
ipindex Index
Type of all indices of vectors, matrices etc.
Definition IpTypes.hpp:20
ipnumber Number
Type of all numbers.
Definition IpTypes.hpp:17
bool IsNull(const SmartPtr< U > &smart_ptr)