Main Page
Namespaces
Classes
Files
File List
File Members
var
build
temp
tmp.niCloInx4p
4.0-0-0
coinor-ipopt
coinor-ipopt-3.10.2
Ipopt
src
Algorithm
IpOrigIpoptNLP.hpp
Go to the documentation of this file.
1
// Copyright (C) 2004, 2010 International Business Machines and others.
2
// All Rights Reserved.
3
// This code is published under the Eclipse Public License.
4
//
5
// $Id: IpOrigIpoptNLP.hpp 1861 2010-12-21 21:34:47Z andreasw $
6
//
7
// Authors: Carl Laird, Andreas Waechter IBM 2004-08-13
8
9
#ifndef __IPORIGIPOPTNLP_HPP__
10
#define __IPORIGIPOPTNLP_HPP__
11
12
#include "
IpIpoptNLP.hpp
"
13
#include "
IpException.hpp
"
14
#include "
IpTimingStatistics.hpp
"
15
16
namespace
Ipopt
17
{
18
20
enum
HessianApproximationType
{
21
EXACT
=0,
22
LIMITED_MEMORY
23
};
24
26
enum
HessianApproximationSpace
{
27
NONLINEAR_VARS
=0,
28
ALL_VARS
29
};
30
37
class
OrigIpoptNLP
:
public
IpoptNLP
38
{
39
public
:
42
OrigIpoptNLP
(
const
SmartPtr<const Journalist>
& jnlst,
43
const
SmartPtr<NLP>
&
nlp
,
44
const
SmartPtr<NLPScalingObject>
& nlp_scaling);
45
47
virtual
~OrigIpoptNLP
();
49
51
virtual
bool
Initialize
(
const
Journalist
& jnlst,
52
const
OptionsList
& options,
53
const
std::string& prefix);
54
57
virtual
bool
InitializeStructures
(
SmartPtr<Vector>
&
x
,
58
bool
init_x,
59
SmartPtr<Vector>
& y_c,
60
bool
init_y_c,
61
SmartPtr<Vector>
& y_d,
62
bool
init_y_d,
63
SmartPtr<Vector>
& z_L,
64
bool
init_z_L,
65
SmartPtr<Vector>
& z_U,
66
bool
init_z_U,
67
SmartPtr<Vector>
& v_L,
68
SmartPtr<Vector>
& v_U
69
);
70
72
virtual
bool
GetWarmStartIterate
(
IteratesVector
& warm_start_iterate)
73
{
74
return
nlp_
->
GetWarmStartIterate
(warm_start_iterate);
75
}
79
virtual
Number
f
(
const
Vector
& x);
80
83
virtual
Number
f
(
const
Vector
& x,
Number
mu);
84
86
virtual
SmartPtr<const Vector>
grad_f
(
const
Vector
& x);
87
90
virtual
SmartPtr<const Vector>
grad_f
(
const
Vector
& x,
Number
mu);
91
93
virtual
SmartPtr<const Vector>
c
(
const
Vector
& x);
94
96
virtual
SmartPtr<const Matrix>
jac_c
(
const
Vector
& x);
97
100
virtual
SmartPtr<const Vector>
d
(
const
Vector
& x);
101
103
virtual
SmartPtr<const Matrix>
jac_d
(
const
Vector
& x);
104
106
virtual
SmartPtr<const SymMatrix>
h
(
const
Vector
& x,
107
Number
obj_factor,
108
const
Vector
& yc,
109
const
Vector
& yd
110
);
111
114
virtual
SmartPtr<const SymMatrix>
h
(
const
Vector
& x,
115
Number
obj_factor,
116
const
Vector
& yc,
117
const
Vector
& yd,
118
Number
mu);
119
123
virtual
SmartPtr<const SymMatrix>
uninitialized_h
();
124
126
virtual
SmartPtr<const Vector>
x_L
()
const
127
{
128
return
x_L_
;
129
}
130
132
virtual
SmartPtr<const Matrix>
Px_L
()
const
133
{
134
return
Px_L_
;
135
}
136
138
virtual
SmartPtr<const Vector>
x_U
()
const
139
{
140
return
x_U_
;
141
}
142
144
virtual
SmartPtr<const Matrix>
Px_U
()
const
145
{
146
return
Px_U_
;
147
}
148
150
virtual
SmartPtr<const Vector>
d_L
()
const
151
{
152
return
d_L_
;
153
}
154
156
virtual
SmartPtr<const Matrix>
Pd_L
()
const
157
{
158
return
Pd_L_
;
159
}
160
162
virtual
SmartPtr<const Vector>
d_U
()
const
163
{
164
return
d_U_
;
165
}
166
168
virtual
SmartPtr<const Matrix>
Pd_U
()
const
169
{
170
return
Pd_U_
;
171
}
172
173
virtual
SmartPtr<const SymMatrixSpace>
HessianMatrixSpace
()
const
174
{
175
return
h_space_
;
176
}
178
180
virtual
void
GetSpaces
(
SmartPtr<const VectorSpace>
& x_space,
181
SmartPtr<const VectorSpace>
& c_space,
182
SmartPtr<const VectorSpace>
& d_space,
183
SmartPtr<const VectorSpace>
& x_l_space,
184
SmartPtr<const MatrixSpace>
& px_l_space,
185
SmartPtr<const VectorSpace>
& x_u_space,
186
SmartPtr<const MatrixSpace>
& px_u_space,
187
SmartPtr<const VectorSpace>
& d_l_space,
188
SmartPtr<const MatrixSpace>
& pd_l_space,
189
SmartPtr<const VectorSpace>
& d_u_space,
190
SmartPtr<const MatrixSpace>
& pd_u_space,
191
SmartPtr<const MatrixSpace>
& Jac_c_space,
192
SmartPtr<const MatrixSpace>
& Jac_d_space,
193
SmartPtr<const SymMatrixSpace>
& Hess_lagrangian_space);
194
197
virtual
void
AdjustVariableBounds
(
const
Vector
& new_x_L,
198
const
Vector
& new_x_U,
199
const
Vector
& new_d_L,
200
const
Vector
& new_d_U);
201
204
virtual
Index
f_evals
()
const
205
{
206
return
f_evals_
;
207
}
208
virtual
Index
grad_f_evals
()
const
209
{
210
return
grad_f_evals_
;
211
}
212
virtual
Index
c_evals
()
const
213
{
214
return
c_evals_
;
215
}
216
virtual
Index
jac_c_evals
()
const
217
{
218
return
jac_c_evals_
;
219
}
220
virtual
Index
d_evals
()
const
221
{
222
return
d_evals_
;
223
}
224
virtual
Index
jac_d_evals
()
const
225
{
226
return
jac_d_evals_
;
227
}
228
virtual
Index
h_evals
()
const
229
{
230
return
h_evals_
;
231
}
233
236
void
FinalizeSolution
(
SolverReturn
status,
237
const
Vector
& x,
const
Vector
& z_L,
const
Vector
& z_U,
238
const
Vector
&
c
,
const
Vector
&
d
,
239
const
Vector
& y_c,
const
Vector
& y_d,
240
Number
obj_value,
241
const
IpoptData
* ip_data,
242
IpoptCalculatedQuantities
* ip_cq);
243
bool
IntermediateCallBack
(
AlgorithmMode
mode,
244
Index
iter,
Number
obj_value,
245
Number
inf_pr,
Number
inf_du,
246
Number
mu,
Number
d_norm,
247
Number
regularization_size,
248
Number
alpha_du,
Number
alpha_pr,
249
Index
ls_trials,
250
SmartPtr<const IpoptData>
ip_data,
251
SmartPtr<IpoptCalculatedQuantities>
ip_cq);
253
257
static
void
RegisterOptions
(
SmartPtr<RegisteredOptions>
roptions);
259
261
SmartPtr<NLP>
nlp
()
262
{
263
return
nlp_
;
264
}
265
267
void
ResetTimes
();
268
269
void
PrintTimingStatistics
(
Journalist
& jnlst,
270
EJournalLevel
level,
271
EJournalCategory
category)
const
;
272
273
Number
TotalFunctionEvaluationCpuTime
()
const
;
274
Number
TotalFunctionEvaluationSysTime
()
const
;
275
Number
TotalFunctionEvaluationWallclockTime
()
const
;
276
277
private
:
279
SmartPtr<const Journalist>
jnlst_
;
280
282
SmartPtr<NLP>
nlp_
;
283
286
SmartPtr<const VectorSpace>
x_space_
;
287
SmartPtr<const VectorSpace>
c_space_
;
288
SmartPtr<const VectorSpace>
d_space_
;
289
SmartPtr<const VectorSpace>
x_l_space_
;
290
SmartPtr<const MatrixSpace>
px_l_space_
;
291
SmartPtr<const VectorSpace>
x_u_space_
;
292
SmartPtr<const MatrixSpace>
px_u_space_
;
293
SmartPtr<const VectorSpace>
d_l_space_
;
294
SmartPtr<const MatrixSpace>
pd_l_space_
;
295
SmartPtr<const VectorSpace>
d_u_space_
;
296
SmartPtr<const MatrixSpace>
pd_u_space_
;
297
SmartPtr<const MatrixSpace>
jac_c_space_
;
298
SmartPtr<const MatrixSpace>
jac_d_space_
;
299
SmartPtr<const SymMatrixSpace>
h_space_
;
300
301
SmartPtr<const MatrixSpace>
scaled_jac_c_space_
;
302
SmartPtr<const MatrixSpace>
scaled_jac_d_space_
;
303
SmartPtr<const SymMatrixSpace>
scaled_h_space_
;
305
308
CachedResults<Number>
f_cache_
;
309
311
CachedResults<SmartPtr<const Vector>
>
grad_f_cache_
;
312
314
CachedResults<SmartPtr<const Vector>
>
c_cache_
;
315
318
CachedResults<SmartPtr<const Matrix>
>
jac_c_cache_
;
319
322
CachedResults<SmartPtr<const Vector>
>
d_cache_
;
323
326
CachedResults<SmartPtr<const Matrix>
>
jac_d_cache_
;
327
330
CachedResults<SmartPtr<const SymMatrix>
>
h_cache_
;
331
333
CachedResults<SmartPtr<const Vector>
>
unscaled_x_cache_
;
334
336
SmartPtr<const Vector>
x_L_
;
337
339
SmartPtr<const Matrix>
Px_L_
;
340
342
SmartPtr<const Vector>
x_U_
;
343
345
SmartPtr<const Matrix>
Px_U_
;
346
348
SmartPtr<const Vector>
d_L_
;
349
351
SmartPtr<const Matrix>
Pd_L_
;
352
354
SmartPtr<const Vector>
d_U_
;
355
357
SmartPtr<const Matrix>
Pd_U_
;
358
360
SmartPtr<const Vector>
orig_x_L_
;
361
363
SmartPtr<const Vector>
orig_x_U_
;
365
375
OrigIpoptNLP
();
376
378
OrigIpoptNLP
(
const
OrigIpoptNLP
&);
379
381
void
operator=
(
const
OrigIpoptNLP
&);
383
390
void
relax_bounds
(
Number
bound_relax_factor,
Vector
& bounds);
392
SmartPtr<const Vector>
get_unscaled_x
(
const
Vector
& x);
394
398
Number
bound_relax_factor_
;
401
bool
honor_original_bounds_
;
404
bool
warm_start_same_structure_
;
406
HessianApproximationType
hessian_approximation_
;
408
HessianApproximationSpace
hessian_approximation_space_
;
411
bool
check_derivatives_for_naninf_
;
414
bool
jac_c_constant_
;
417
bool
jac_d_constant_
;
419
bool
hessian_constant_
;
421
424
Index
f_evals_
;
425
Index
grad_f_evals_
;
426
Index
c_evals_
;
427
Index
jac_c_evals_
;
428
Index
d_evals_
;
429
Index
jac_d_evals_
;
430
Index
h_evals_
;
432
434
bool
initialized_
;
435
438
TimedTask
f_eval_time_
;
439
TimedTask
grad_f_eval_time_
;
440
TimedTask
c_eval_time_
;
441
TimedTask
jac_c_eval_time_
;
442
TimedTask
d_eval_time_
;
443
TimedTask
jac_d_eval_time_
;
444
TimedTask
h_eval_time_
;
446
};
447
448
}
// namespace Ipopt
449
450
#endif
Generated on Mon Mar 17 2014 19:49:13 by
1.8.1.2