Main Page
Namespaces
Classes
Files
File List
File Members
tmp
buildd
coinor-ipopt-3.10.2
Ipopt
src
Algorithm
IpIpoptNLP.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: IpIpoptNLP.hpp 1861 2010-12-21 21:34:47Z andreasw $
6
//
7
// Authors: Carl Laird, Andreas Waechter IBM 2004-08-13
8
9
#ifndef __IPIPOPTNLP_HPP__
10
#define __IPIPOPTNLP_HPP__
11
12
#include "
IpNLP.hpp
"
13
#include "
IpJournalist.hpp
"
14
#include "
IpNLPScaling.hpp
"
15
16
namespace
Ipopt
17
{
18
// forward declarations
19
class
IteratesVector;
20
28
class
IpoptNLP
:
public
ReferencedObject
29
{
30
public
:
33
IpoptNLP
(
const
SmartPtr<NLPScalingObject>
nlp_scaling)
34
:
35
nlp_scaling_
(nlp_scaling)
36
{}
37
39
virtual
~IpoptNLP
()
40
{}
42
45
virtual
bool
Initialize
(
const
Journalist
& jnlst,
46
const
OptionsList
& options,
47
const
std::string& prefix)
48
{
49
bool
ret =
true
;
50
if
(
IsValid
(
nlp_scaling_
)) {
51
ret =
nlp_scaling_
->
Initialize
(jnlst, options, prefix);
52
}
53
return
ret;
54
}
55
59
DECLARE_STD_EXCEPTION
(Eval_Error);
61
63
virtual
bool
InitializeStructures
(
SmartPtr<Vector>
&
x
,
64
bool
init_x,
65
SmartPtr<Vector>
& y_c,
66
bool
init_y_c,
67
SmartPtr<Vector>
& y_d,
68
bool
init_y_d,
69
SmartPtr<Vector>
& z_L,
70
bool
init_z_L,
71
SmartPtr<Vector>
& z_U,
72
bool
init_z_U,
73
SmartPtr<Vector>
& v_L,
74
SmartPtr<Vector>
& v_U
75
) = 0;
76
78
virtual
bool
GetWarmStartIterate
(
IteratesVector
& warm_start_iterate)=0;
79
83
virtual
Number
f
(
const
Vector
&
x
) = 0;
84
86
virtual
SmartPtr<const Vector>
grad_f
(
const
Vector
&
x
) = 0;
87
89
virtual
SmartPtr<const Vector>
c
(
const
Vector
&
x
) = 0;
90
92
virtual
SmartPtr<const Matrix>
jac_c
(
const
Vector
&
x
) = 0;
93
96
virtual
SmartPtr<const Vector>
d
(
const
Vector
&
x
) = 0;
97
99
virtual
SmartPtr<const Matrix>
jac_d
(
const
Vector
&
x
) = 0;
100
102
virtual
SmartPtr<const SymMatrix>
h
(
const
Vector
&
x
,
103
Number
obj_factor,
104
const
Vector
& yc,
105
const
Vector
& yd
106
) = 0;
107
109
virtual
SmartPtr<const Vector>
x_L
()
const
= 0;
110
112
virtual
SmartPtr<const Matrix>
Px_L
()
const
= 0;
113
115
virtual
SmartPtr<const Vector>
x_U
()
const
= 0;
116
118
virtual
SmartPtr<const Matrix>
Px_U
()
const
= 0;
119
121
virtual
SmartPtr<const Vector>
d_L
()
const
= 0;
122
124
virtual
SmartPtr<const Matrix>
Pd_L
()
const
= 0;
125
127
virtual
SmartPtr<const Vector>
d_U
()
const
= 0;
128
130
virtual
SmartPtr<const Matrix>
Pd_U
()
const
= 0;
131
134
virtual
SmartPtr<const SymMatrixSpace>
HessianMatrixSpace
()
const
= 0;
136
138
virtual
void
GetSpaces
(
SmartPtr<const VectorSpace>
& x_space,
139
SmartPtr<const VectorSpace>
& c_space,
140
SmartPtr<const VectorSpace>
& d_space,
141
SmartPtr<const VectorSpace>
& x_l_space,
142
SmartPtr<const MatrixSpace>
& px_l_space,
143
SmartPtr<const VectorSpace>
& x_u_space,
144
SmartPtr<const MatrixSpace>
& px_u_space,
145
SmartPtr<const VectorSpace>
& d_l_space,
146
SmartPtr<const MatrixSpace>
& pd_l_space,
147
SmartPtr<const VectorSpace>
& d_u_space,
148
SmartPtr<const MatrixSpace>
& pd_u_space,
149
SmartPtr<const MatrixSpace>
& Jac_c_space,
150
SmartPtr<const MatrixSpace>
& Jac_d_space,
151
SmartPtr<const SymMatrixSpace>
& Hess_lagrangian_space) = 0;
152
155
virtual
void
AdjustVariableBounds
(
const
Vector
& new_x_L,
156
const
Vector
& new_x_U,
157
const
Vector
& new_d_L,
158
const
Vector
& new_d_U)=0;
159
162
virtual
Index
f_evals
()
const
= 0;
163
virtual
Index
grad_f_evals
()
const
= 0;
164
virtual
Index
c_evals
()
const
= 0;
165
virtual
Index
jac_c_evals
()
const
= 0;
166
virtual
Index
d_evals
()
const
= 0;
167
virtual
Index
jac_d_evals
()
const
= 0;
168
virtual
Index
h_evals
()
const
= 0;
170
180
virtual
bool
objective_depends_on_mu
()
const
181
{
182
return
false
;
183
}
184
187
virtual
Number
f
(
const
Vector
&
x
,
Number
mu) = 0;
188
191
virtual
SmartPtr<const Vector>
grad_f
(
const
Vector
&
x
,
Number
mu) = 0;
192
195
virtual
SmartPtr<const SymMatrix>
h
(
const
Vector
&
x
,
196
Number
obj_factor,
197
const
Vector
& yc,
198
const
Vector
& yd,
199
Number
mu) = 0;
200
204
virtual
SmartPtr<const SymMatrix>
uninitialized_h
() = 0;
206
209
virtual
void
FinalizeSolution
(
SolverReturn
status,
210
const
Vector
&
x
,
const
Vector
& z_L,
const
Vector
& z_U,
211
const
Vector
&
c
,
const
Vector
&
d
,
212
const
Vector
& y_c,
const
Vector
& y_d,
213
Number
obj_value,
214
const
IpoptData
* ip_data,
215
IpoptCalculatedQuantities
* ip_cq)=0;
216
217
virtual
bool
IntermediateCallBack
(
AlgorithmMode
mode,
218
Index
iter,
Number
obj_value,
219
Number
inf_pr,
Number
inf_du,
220
Number
mu,
Number
d_norm,
221
Number
regularization_size,
222
Number
alpha_du,
Number
alpha_pr,
223
Index
ls_trials,
224
SmartPtr<const IpoptData>
ip_data,
225
SmartPtr<IpoptCalculatedQuantities>
ip_cq)=0;
227
229
SmartPtr<NLPScalingObject>
NLP_scaling
()
const
230
{
231
DBG_ASSERT
(
IsValid
(
nlp_scaling_
));
232
return
nlp_scaling_
;
233
}
234
235
private
:
236
245
247
IpoptNLP
(
const
IpoptNLP
&);
248
250
void
operator=
(
const
IpoptNLP
&);
252
253
SmartPtr<NLPScalingObject>
nlp_scaling_
;
254
};
255
256
}
// namespace Ipopt
257
258
#endif
Generated on Tue Jun 26 2012 17:01:43 by
1.8.1.1