1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
// Copyright (C) 2008, 2009 International Business Machines and others.
// All Rights Reserved.
// This code is published under the Eclipse Public License.
//
// Authors: Andreas Waechter IBM 2008-08-31
#ifndef __IPINEXACTDATA_HPP__
#define __IPINEXACTDATA_HPP__
#include "IpIpoptData.hpp"
namespace Ipopt
{
/** Class to organize all the additional data required by the
* Chen-Goldfarb penalty function algorithm.
*/
class InexactData: public IpoptAdditionalData
{
public:
/**@name Constructors/Destructors */
///@{
/** Constructor */
InexactData();
/** Destructor */
~InexactData();
///@}
/** @name Methods overloaded from IpoptAdditionalData */
///@{
/** This method must be called to initialize the global
* algorithmic parameters.
*
* The parameters are taken from the OptionsList object.
*/
bool Initialize(
const Journalist& jnlst,
const OptionsList& options,
const std::string& prefix
);
/** Initialize Data Structures at the beginning. */
bool InitializeDataStructures();
/** Do whatever is necessary to accept a trial point as current
* iterate.
*
* This is also used to finish an iteration, i.e., to
* release memory, and to reset any flags for a new iteration.
*/
void AcceptTrialPoint();
///@}
/** @name Normal step set and accessor methods */
///@{
void set_normal_x(
SmartPtr<Vector>& normal_x
)
{
normal_x_ = ConstPtr(normal_x);
normal_x = NULL;
}
void set_normal_s(
SmartPtr<Vector>& normal_s
)
{
normal_s_ = ConstPtr(normal_s);
normal_s = NULL;
}
SmartPtr<const Vector> normal_x()
{
return normal_x_;
}
SmartPtr<const Vector> normal_s()
{
return normal_s_;
}
///@}
/** @name Tangential step set and accessor methods */
///@{
void set_tangential_x(
SmartPtr<const Vector>& tangential_x
)
{
tangential_x_ = tangential_x;
tangential_x = NULL;
}
void set_tangential_s(
SmartPtr<const Vector>& tangential_s
)
{
tangential_s_ = tangential_s;
tangential_s = NULL;
}
SmartPtr<const Vector> tangential_x()
{
return tangential_x_;
}
SmartPtr<const Vector> tangential_s()
{
return tangential_s_;
}
///@}
/** @name Flag indicating if most recent step has been fully accepted.
*
* This is used to determine if the trust region
* radius should be increased.
*/
///@{
void set_full_step_accepted(
bool full_step_accepted
)
{
full_step_accepted_ = full_step_accepted;
}
bool full_step_accepted()
{
return full_step_accepted_;
}
///@}
/** @name Current value of penalty parameter */
///@{
void set_curr_nu(
Number nu
)
{
curr_nu_ = nu;
}
Number curr_nu()
{
return curr_nu_;
}
///@}
/** @name Current normal step computation flag */
///@{
void set_compute_normal(
bool compute_normal
)
{
compute_normal_ = compute_normal;
}
bool compute_normal()
{
return compute_normal_;
}
///@}
/** @name Next iteration normal step computation flag */
///@{
void set_next_compute_normal(
bool next_compute_normal
)
{
next_compute_normal_ = next_compute_normal;
}
bool next_compute_normal()
{
return next_compute_normal_;
}
///@}
private:
/**@name 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.
*/
///@{
/** Copy Constructor */
InexactData(
const InexactData&
);
/** Overloaded Assignment Operator */
void operator=(
const InexactData&
);
///@}
/** @name Normal step */
///@{
SmartPtr<const Vector> normal_x_;
SmartPtr<const Vector> normal_s_;
///@}
/** @name Tangential step */
///@{
SmartPtr<const Vector> tangential_x_;
SmartPtr<const Vector> tangential_s_;
///@}
/** Flag indicating if most recent step has been fully accepted */
bool full_step_accepted_;
/** current value of penalty parameter */
Number curr_nu_;
/** current normal step computation flag */
bool compute_normal_;
/** next iteration normal step computation flag */
bool next_compute_normal_;
};
} // namespace Ipopt
#endif