Ipopt
3.11.4
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
src
Interfaces
IpStdInterfaceTNLP.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: IpStdInterfaceTNLP.hpp 1861 2010-12-21 21:34:47Z andreasw $
6
//
7
// Authors: Carl Laird, Andreas Waechter IBM 2004-08-13
8
9
#ifndef __IPSTDINTERFACETNLP_HPP__
10
#define __IPSTDINTERFACETNLP_HPP__
11
12
#include "
IpUtils.hpp
"
13
#include "
IpTNLP.hpp
"
14
#include "
IpJournalist.hpp
"
15
#include "
IpException.hpp
"
16
#include "
IpStdCInterface.h
"
17
#include "
IpSmartPtr.hpp
"
18
19
namespace
Ipopt
20
{
23
DECLARE_STD_EXCEPTION
(INVALID_STDINTERFACE_NLP);
24
30
class
StdInterfaceTNLP
:
public
TNLP
31
{
32
public
:
39
StdInterfaceTNLP
(
Index
n_var,
40
const
Number
*
x_L
,
const
Number
*
x_U
,
41
Index
n_con,
42
const
Number
*
g_L
,
const
Number
*
g_U
,
43
Index
nele_jac
,
44
Index
nele_hess
,
45
Index
index_style
,
46
const
Number
* start_x,
47
const
Number
* start_lam,
48
const
Number
* start_z_L,
49
const
Number
* start_z_U,
50
Eval_F_CB
eval_f
,
51
Eval_G_CB
eval_g
,
52
Eval_Grad_F_CB
eval_grad_f
,
53
Eval_Jac_G_CB
eval_jac_g
,
54
Eval_H_CB
eval_h
,
55
Intermediate_CB
intermediate_cb
,
56
Number
* x_sol,
57
Number
* z_L_sol,
58
Number
* z_U_sol,
59
Number
* g_sol,
60
Number
* lam_sol,
61
Number
* obj_sol,
62
UserDataPtr
user_data
,
63
Number
obj_scaling
=1,
64
const
Number
*
x_scaling
= NULL,
65
const
Number
*
g_scaling
= NULL);
66
68
virtual
~StdInterfaceTNLP
();
70
75
virtual
bool
get_nlp_info
(
Index
& n,
Index
&
m
,
Index
& nnz_jac_g,
76
Index
& nnz_h_lag,
IndexStyleEnum
& index_style);
77
79
virtual
bool
get_bounds_info
(
Index
n,
Number
* x_l,
Number
* x_u,
80
Index
m,
Number
* g_l,
Number
* g_u);
81
84
virtual
bool
get_scaling_parameters
(
Number
&
obj_scaling
,
85
bool
& use_x_scaling,
Index
n,
86
Number
*
x_scaling
,
87
bool
& use_g_scaling,
Index
m,
88
Number
*
g_scaling
);
89
91
virtual
bool
get_starting_point
(
Index
n,
bool
init_x,
Number
*
x
,
92
bool
init_z,
Number
* z_L,
Number
* z_U,
93
Index
m,
bool
init_lambda,
Number
* lambda);
94
96
virtual
bool
eval_f
(
Index
n,
const
Number
* x,
bool
new_x,
97
Number
& obj_value);
98
101
virtual
bool
eval_grad_f
(
Index
n,
const
Number
* x,
bool
new_x,
102
Number
* grad_f);
103
105
virtual
bool
eval_g
(
Index
n,
const
Number
* x,
bool
new_x,
Index
m,
106
Number
*
g
);
107
111
virtual
bool
eval_jac_g
(
Index
n,
const
Number
* x,
bool
new_x,
Index
m,
112
Index
nele_jac,
Index
* iRow,
Index
*jCol,
113
Number
* values);
114
117
virtual
bool
eval_h
(
Index
n,
const
Number
* x,
bool
new_x,
118
Number
obj_factor,
Index
m,
const
Number
* lambda,
119
bool
new_lambda,
Index
nele_hess,
Index
* iRow,
120
Index
* jCol,
Number
* values);
121
123
virtual
bool
intermediate_callback
(
AlgorithmMode
mode,
124
Index
iter,
Number
obj_value,
125
Number
inf_pr,
Number
inf_du,
126
Number
mu,
Number
d_norm,
127
Number
regularization_size,
128
Number
alpha_du,
Number
alpha_pr,
129
Index
ls_trials,
130
const
IpoptData
* ip_data,
131
IpoptCalculatedQuantities
* ip_cq);
133
136
virtual
void
finalize_solution
(
SolverReturn
status,
137
Index
n,
const
Number
* x,
const
Number
* z_L,
const
Number
* z_U,
138
Index
m,
const
Number
* g,
const
Number
* lambda,
139
Number
obj_value,
140
const
IpoptData
* ip_data,
141
IpoptCalculatedQuantities
* ip_cq);
143
144
private
:
146
SmartPtr<const Journalist>
jnlst_
;
147
151
const
Index
n_var_
;
153
const
Index
n_con_
;
155
const
Number
*
x_L_
;
157
const
Number
*
x_U_
;
159
const
Number
*
g_L_
;
161
const
Number
*
g_U_
;
163
const
Index
nele_jac_
;
165
const
Index
nele_hess_
;
167
const
Index
index_style_
;
169
const
Number
*
start_x_
;
172
const
Number
*
start_lam_
;
175
const
Number
*
start_z_L_
;
178
const
Number
*
start_z_U_
;
180
Eval_F_CB
eval_f_
;
182
Eval_G_CB
eval_g_
;
185
Eval_Grad_F_CB
eval_grad_f_
;
187
Eval_Jac_G_CB
eval_jac_g_
;
189
Eval_H_CB
eval_h_
;
191
Intermediate_CB
intermediate_cb_
;
193
UserDataPtr
user_data_
;
195
Number
obj_scaling_
;
197
const
Number
*
x_scaling_
;
199
const
Number
*
g_scaling_
;
201
202
204
Number
*
non_const_x_
;
205
207
Number
*
x_sol_
;
208
Number
*
z_L_sol_
;
209
Number
*
z_U_sol_
;
210
Number
*
g_sol_
;
211
Number
*
lambda_sol_
;
212
Number
*
obj_sol_
;
213
216
void
apply_new_x
(
bool
new_x,
Index
n,
const
Number
* x);
217
227
StdInterfaceTNLP
();
228
230
StdInterfaceTNLP
(
const
StdInterfaceTNLP
&);
231
233
void
operator=
(
const
StdInterfaceTNLP
&);
235
236
};
237
238
}
// namespace Ipopt
239
240
#endif
Generated on Mon Oct 21 2013 19:08:15 for Ipopt by
1.8.4