Main Page
Namespaces
Classes
Files
File List
File Members
build
buildd
coinor-ipopt-3.10.2
Ipopt
src
Algorithm
IpRestoIpoptNLP.hpp
Go to the documentation of this file.
1
// Copyright (C) 2004, 2006 International Business Machines and others.
2
// All Rights Reserved.
3
// This code is published under the Eclipse Public License.
4
//
5
// $Id: IpRestoIpoptNLP.hpp 1861 2010-12-21 21:34:47Z andreasw $
6
//
7
// Authors: Carl Laird, Andreas Waechter IBM 2004-08-13
8
9
#ifndef __IPRESTOIPOPTNLP_HPP__
10
#define __IPRESTOIPOPTNLP_HPP__
11
12
#include "
IpIpoptNLP.hpp
"
13
#include "
IpIpoptData.hpp
"
14
#include "
IpIpoptCalculatedQuantities.hpp
"
15
#include "
IpCompoundMatrix.hpp
"
16
#include "
IpCompoundSymMatrix.hpp
"
17
#include "
IpCompoundVector.hpp
"
18
#include "
IpIdentityMatrix.hpp
"
19
#include "
IpDiagMatrix.hpp
"
20
#include "
IpZeroMatrix.hpp
"
21
#include "
IpOrigIpoptNLP.hpp
"
22
23
namespace
Ipopt
24
{
25
32
class
RestoIpoptNLP
:
public
IpoptNLP
33
{
34
public
:
37
RestoIpoptNLP
(
IpoptNLP
& orig_ip_nlp,
38
IpoptData
& orig_ip_data,
39
IpoptCalculatedQuantities
& orig_ip_cq);
40
42
~RestoIpoptNLP
();
44
46
virtual
bool
Initialize
(
const
Journalist
& jnlst,
47
const
OptionsList
& options,
48
const
std::string& prefix);
49
52
virtual
bool
InitializeStructures
(
SmartPtr<Vector>
&
x
,
53
bool
init_x,
54
SmartPtr<Vector>
& y_c,
55
bool
init_y_c,
56
SmartPtr<Vector>
& y_d,
57
bool
init_y_d,
58
SmartPtr<Vector>
& z_L,
59
bool
init_z_L,
60
SmartPtr<Vector>
& z_U,
61
bool
init_z_U,
62
SmartPtr<Vector>
& v_L,
63
SmartPtr<Vector>
& v_U
64
);
65
67
virtual
bool
GetWarmStartIterate
(
IteratesVector
& warm_start_iterate)
68
{
69
return
false
;
70
}
71
74
void
FinalizeSolution
(
SolverReturn
status,
75
const
Vector
& x,
const
Vector
& z_L,
const
Vector
& z_U,
76
const
Vector
&
c
,
const
Vector
&
d
,
77
const
Vector
& y_c,
const
Vector
& y_d,
78
Number
obj_value,
79
const
IpoptData
* ip_data,
80
IpoptCalculatedQuantities
* ip_cq)
81
{}
83
89
virtual
bool
objective_depends_on_mu
()
const
90
{
91
return
true
;
92
}
93
95
virtual
Number
f
(
const
Vector
& x);
96
98
virtual
Number
f
(
const
Vector
& x,
Number
mu);
99
101
virtual
SmartPtr<const Vector>
grad_f
(
const
Vector
& x);
102
104
virtual
SmartPtr<const Vector>
grad_f
(
const
Vector
& x,
Number
mu);
105
107
virtual
SmartPtr<const Vector>
c
(
const
Vector
& x);
108
110
virtual
SmartPtr<const Matrix>
jac_c
(
const
Vector
& x);
111
114
virtual
SmartPtr<const Vector>
d
(
const
Vector
& x);
115
117
virtual
SmartPtr<const Matrix>
jac_d
(
const
Vector
& x);
118
121
virtual
SmartPtr<const SymMatrix>
h
(
const
Vector
& x,
122
Number
obj_factor,
123
const
Vector
& yc,
124
const
Vector
& yd
125
);
126
128
virtual
SmartPtr<const SymMatrix>
h
(
const
Vector
& x,
129
Number
obj_factor,
130
const
Vector
& yc,
131
const
Vector
& yd,
132
Number
mu);
133
137
virtual
SmartPtr<const SymMatrix>
uninitialized_h
();
138
140
virtual
SmartPtr<const Vector>
x_L
()
const
141
{
142
return
GetRawPtr
(
x_L_
);
143
}
144
146
virtual
SmartPtr<const Matrix>
Px_L
()
const
147
{
148
return
GetRawPtr
(
Px_L_
);
149
}
150
152
virtual
SmartPtr<const Vector>
x_U
()
const
153
{
154
return
GetRawPtr
(
x_U_
);
155
}
156
158
virtual
SmartPtr<const Matrix>
Px_U
()
const
159
{
160
return
GetRawPtr
(
Px_U_
);
161
}
162
164
virtual
SmartPtr<const Vector>
d_L
()
const
165
{
166
return
GetRawPtr
(
d_L_
);
167
}
168
170
virtual
SmartPtr<const Matrix>
Pd_L
()
const
171
{
172
return
GetRawPtr
(
Pd_L_
);
173
}
174
176
virtual
SmartPtr<const Vector>
d_U
()
const
177
{
178
return
GetRawPtr
(
d_U_
);
179
}
180
182
virtual
SmartPtr<const Matrix>
Pd_U
()
const
183
{
184
return
GetRawPtr
(
Pd_U_
);
185
}
186
187
virtual
SmartPtr<const SymMatrixSpace>
HessianMatrixSpace
()
const
188
{
189
return
GetRawPtr
(
h_space_
);
190
}
192
194
virtual
void
GetSpaces
(
SmartPtr<const VectorSpace>
& x_space,
195
SmartPtr<const VectorSpace>
& c_space,
196
SmartPtr<const VectorSpace>
& d_space,
197
SmartPtr<const VectorSpace>
& x_l_space,
198
SmartPtr<const MatrixSpace>
& px_l_space,
199
SmartPtr<const VectorSpace>
& x_u_space,
200
SmartPtr<const MatrixSpace>
& px_u_space,
201
SmartPtr<const VectorSpace>
& d_l_space,
202
SmartPtr<const MatrixSpace>
& pd_l_space,
203
SmartPtr<const VectorSpace>
& d_u_space,
204
SmartPtr<const MatrixSpace>
& pd_u_space,
205
SmartPtr<const MatrixSpace>
& Jac_c_space,
206
SmartPtr<const MatrixSpace>
& Jac_d_space,
207
SmartPtr<const SymMatrixSpace>
& Hess_lagrangian_space);
210
virtual
void
AdjustVariableBounds
(
const
Vector
& new_x_L,
211
const
Vector
& new_x_U,
212
const
Vector
& new_d_L,
213
const
Vector
& new_d_U);
214
216
bool
IntermediateCallBack
(
AlgorithmMode
mode,
217
Index
iter,
Number
obj_value,
218
Number
inf_pr,
Number
inf_du,
219
Number
mu,
Number
d_norm,
220
Number
regularization_size,
221
Number
alpha_du,
Number
alpha_pr,
222
Index
ls_trials,
223
SmartPtr<const IpoptData>
ip_data,
224
SmartPtr<IpoptCalculatedQuantities>
ip_cq);
225
229
IpoptNLP
&
OrigIpNLP
()
const
230
{
231
return
*
orig_ip_nlp_
;
232
}
233
IpoptData
&
OrigIpData
()
const
234
{
235
return
*
orig_ip_data_
;
236
}
237
IpoptCalculatedQuantities
&
OrigIpCq
()
const
238
{
239
return
*
orig_ip_cq_
;
240
}
242
245
Number
Rho
()
const
246
{
247
return
rho_
;
248
}
249
252
virtual
Index
f_evals
()
const
253
{
254
return
f_evals_
;
255
}
256
virtual
Index
grad_f_evals
()
const
257
{
258
return
grad_f_evals_
;
259
}
260
virtual
Index
c_evals
()
const
261
{
262
return
c_evals_
;
263
}
264
virtual
Index
jac_c_evals
()
const
265
{
266
return
jac_c_evals_
;
267
}
268
virtual
Index
d_evals
()
const
269
{
270
return
d_evals_
;
271
}
272
virtual
Index
jac_d_evals
()
const
273
{
274
return
jac_d_evals_
;
275
}
276
virtual
Index
h_evals
()
const
277
{
278
return
h_evals_
;
279
}
281
283
Number
Eta
(
Number
mu)
const
;
284
287
SmartPtr<const Vector>
DR_x
()
const
288
{
289
return
ConstPtr
(
dr_x_
);
290
}
291
295
static
void
RegisterOptions
(
SmartPtr<RegisteredOptions>
roptions);
297
298
private
:
302
SmartPtr<IpoptNLP>
orig_ip_nlp_
;
303
305
SmartPtr<IpoptData>
orig_ip_data_
;
306
308
SmartPtr<IpoptCalculatedQuantities>
orig_ip_cq_
;
310
313
SmartPtr<CompoundVectorSpace>
x_space_
;
314
315
SmartPtr<const VectorSpace>
c_space_
;
316
317
SmartPtr<const VectorSpace>
d_space_
;
318
319
SmartPtr<CompoundVectorSpace>
x_l_space_
;
320
321
SmartPtr<CompoundMatrixSpace>
px_l_space_
;
322
323
SmartPtr<const VectorSpace>
x_u_space_
;
324
325
SmartPtr<CompoundMatrixSpace>
px_u_space_
;
326
327
SmartPtr<const VectorSpace>
d_l_space_
;
328
329
SmartPtr<const MatrixSpace>
pd_l_space_
;
330
331
SmartPtr<const VectorSpace>
d_u_space_
;
332
333
SmartPtr<const MatrixSpace>
pd_u_space_
;
334
335
SmartPtr<CompoundMatrixSpace>
jac_c_space_
;
336
337
SmartPtr<CompoundMatrixSpace>
jac_d_space_
;
338
339
SmartPtr<CompoundSymMatrixSpace>
h_space_
;
341
345
SmartPtr<CompoundVector>
x_L_
;
346
348
SmartPtr<CompoundMatrix>
Px_L_
;
349
351
SmartPtr<const Vector>
x_U_
;
352
354
SmartPtr<CompoundMatrix>
Px_U_
;
355
357
SmartPtr<const Vector>
d_L_
;
358
360
SmartPtr<const Matrix>
Pd_L_
;
361
363
SmartPtr<const Vector>
d_U_
;
364
366
SmartPtr<const Matrix>
Pd_U_
;
368
372
/* ToDo make this parameter? */
373
Number
rho_
;
375
Number
eta_factor_
;
377
Number
eta_mu_exponent_
;
378
// TODO in the following we should use pointers to CONST values
380
SmartPtr<Vector>
dr_x_
;
381
SmartPtr<DiagMatrix>
DR_x_
;
//TODO We can get rid of one of the dr DR
383
SmartPtr<Vector>
x_ref_
;
385
395
RestoIpoptNLP
();
396
398
RestoIpoptNLP
(
const
RestoIpoptNLP
&);
399
401
void
operator=
(
const
RestoIpoptNLP
&);
403
409
bool
evaluate_orig_obj_at_resto_trial_
;
411
HessianApproximationType
hessian_approximation_
;
413
415
bool
initialized_
;
416
419
Index
f_evals_
;
420
Index
grad_f_evals_
;
421
Index
c_evals_
;
422
Index
jac_c_evals_
;
423
Index
d_evals_
;
424
Index
jac_d_evals_
;
425
Index
h_evals_
;
427
};
428
429
}
// namespace Ipopt
430
431
#endif
Generated on Fri Jun 29 2012 06:35:13 by
1.8.1.1