Ipopt 3.12.10

- Main Page
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
IpStdCInterface.h
Go to the documentation of this file.
1 /*************************************************************************
2 Copyright (C) 2004, 2010 International Business Machines and others.
3 All Rights Reserved.
4 This code is published under the Eclipse Public License.
5
6 $Id: IpStdCInterface.h 2082 2012-02-16 03:00:34Z andreasw $
7
8 Authors: Carl Laird, Andreas Waechter IBM 2004-09-02
9 *************************************************************************/
10
11 #ifndef __IPSTDCINTERFACE_H__
12 #define __IPSTDCINTERFACE_H__
13
14 #ifndef IPOPT_EXPORT
15 #ifdef _MSC_VER
16 #ifdef IPOPT_DLL
17 #define IPOPT_EXPORT(type) __declspec(dllexport) type __cdecl
18 #else
19 #define IPOPT_EXPORT(type) type __cdecl
20 #endif
21 #else
22 #define IPOPT_EXPORT(type) type
23 #endif
24 #endif
25
26 #ifdef __cplusplus
27 extern "C"
28 {
29 #endif
30
33 typedef double Number;
34
37 typedef int Index;
38
41 typedef int Int;
42
43 /* This includes the SolverReturn enum type */
44 #include "IpReturnCodes.h"
45
49 struct IpoptProblemInfo;
50
52 typedef struct IpoptProblemInfo* IpoptProblem;
53
55 typedef int Bool;
56 #ifndef TRUE
57 # define TRUE (1)
58 #endif
59 #ifndef FALSE
60 # define FALSE (0)
61 #endif
62
65 typedef void * UserDataPtr;
66
70 typedef Bool (*Eval_F_CB)(Index n, Number* x, Bool new_x,
71 Number* obj_value, UserDataPtr user_data);
72
76 typedef Bool (*Eval_Grad_F_CB)(Index n, Number* x, Bool new_x,
77 Number* grad_f, UserDataPtr user_data);
78
82 typedef Bool (*Eval_G_CB)(Index n, Number* x, Bool new_x,
83 Index m, Number* g, UserDataPtr user_data);
84
88 typedef Bool (*Eval_Jac_G_CB)(Index n, Number *x, Bool new_x,
89 Index m, Index nele_jac,
90 Index *iRow, Index *jCol, Number *values,
91 UserDataPtr user_data);
92
96 typedef Bool (*Eval_H_CB)(Index n, Number *x, Bool new_x, Number obj_factor,
97 Index m, Number *lambda, Bool new_lambda,
98 Index nele_hess, Index *iRow, Index *jCol,
99 Number *values, UserDataPtr user_data);
100
108 typedef Bool (*Intermediate_CB)(Index alg_mod, /* 0 is regular, 1 is resto */
109 Index iter_count, Number obj_value,
110 Number inf_pr, Number inf_du,
111 Number mu, Number d_norm,
112 Number regularization_size,
113 Number alpha_du, Number alpha_pr,
114 Index ls_trials, UserDataPtr user_data);
115
127 IPOPT_EXPORT(IpoptProblem) CreateIpoptProblem(
128 Index n
129 , Number* x_L
137 , Number* x_U
145 , Index m
146 , Number* g_L
154 , Number* g_U
162 , Index nele_jac
164 , Index nele_hess
166 , Index index_style
168 , Eval_F_CB eval_f
170 , Eval_G_CB eval_g
172 , Eval_Grad_F_CB eval_grad_f
175 , Eval_Jac_G_CB eval_jac_g
178 , Eval_H_CB eval_h
180 );
181
184 IPOPT_EXPORT(void) FreeIpoptProblem(IpoptProblem ipopt_problem);
185
186
189 IPOPT_EXPORT(Bool) AddIpoptStrOption(IpoptProblem ipopt_problem, char* keyword, char* val);
190
193 IPOPT_EXPORT(Bool) AddIpoptNumOption(IpoptProblem ipopt_problem, char* keyword, Number val);
194
197 IPOPT_EXPORT(Bool) AddIpoptIntOption(IpoptProblem ipopt_problem, char* keyword, Int val);
198
202 IPOPT_EXPORT(Bool) OpenIpoptOutputFile(IpoptProblem ipopt_problem, char* file_name,
203 Int print_level);
204
209 IPOPT_EXPORT(Bool) SetIpoptProblemScaling(IpoptProblem ipopt_problem,
210 Number obj_scaling,
211 Number* x_scaling,
212 Number* g_scaling);
213
223 IPOPT_EXPORT(Bool) SetIntermediateCallback(IpoptProblem ipopt_problem,
224 Intermediate_CB intermediate_cb);
225
231 IPOPT_EXPORT(enum ApplicationReturnStatus) IpoptSolve(
232 IpoptProblem ipopt_problem
236 , Number* x
238 , Number* g
240 , Number* obj_val
242 , Number* mult_g
247 , Number* mult_x_L
252 , Number* mult_x_U
257 , UserDataPtr user_data
261 );
262
267 #ifdef __cplusplus
268 } /* extern "C" { */
269 #endif
270
271 #endif
Intermediate_CB
Bool(* Intermediate_CB)(Index alg_mod, Index iter_count, Number obj_value, Number inf_pr, Number inf_du, Number mu, Number d_norm, Number regularization_size, Number alpha_du, Number alpha_pr, Index ls_trials, UserDataPtr user_data)
Type defining the callback function for giving intermediate execution control to the user...
Definition: IpStdCInterface.h:108
Eval_Grad_F_CB
Bool(* Eval_Grad_F_CB)(Index n, Number *x, Bool new_x, Number *grad_f, UserDataPtr user_data)
Type defining the callback function for evaluating the gradient of the objective function.
Definition: IpStdCInterface.h:76
Eval_F_CB
Bool(* Eval_F_CB)(Index n, Number *x, Bool new_x, Number *obj_value, UserDataPtr user_data)
Type defining the callback function for evaluating the value of the objective function.
Definition: IpStdCInterface.h:70
x
Number * x
Input: Starting point Output: Optimal solution.
Definition: IpStdCInterface.h:238
IpReturnCodes.h
Index
int Index
Type for all incides.
Definition: IpStdCInterface.h:37
print_level
char Int print_level
Definition: IpStdCInterface.h:202
index_style
Number Number Index Number Number Index Index Index index_style
indexing style for iRow &amp; jCol, 0 for C style, 1 for Fortran style
Definition: IpStdCInterface.h:137
m
Number Number Index m
Number of constraints.
Definition: IpStdCInterface.h:137
Int
int Int
Type for all integers.
Definition: IpStdCInterface.h:41
g
Number Number * g
Values of constraint at final point (output only - ignored if set to NULL)
Definition: IpStdCInterface.h:238
eval_h
Number Number Index Number Number Index Index Index Eval_F_CB Eval_G_CB Eval_Grad_F_CB Eval_Jac_G_CB Eval_H_CB eval_h
Callback function for evaluating Hessian of Lagrangian function.
Definition: IpStdCInterface.h:137
Bool
int Bool
define a boolean type for C
Definition: IpStdCInterface.h:55
IpoptProblem
struct IpoptProblemInfo * IpoptProblem
Pointer to a Ipopt Problem.
Definition: IpStdCInterface.h:52
eval_grad_f
Number Number Index Number Number Index Index Index Eval_F_CB Eval_G_CB Eval_Grad_F_CB eval_grad_f
Callback function for evaluating gradient of objective function.
Definition: IpStdCInterface.h:137
obj_val
Number Number Number * obj_val
Final value of objective function (output only - ignored if set to NULL)
Definition: IpStdCInterface.h:238
g_U
Number Number Index Number Number * g_U
Upper bounds on constraints.
Definition: IpStdCInterface.h:137
val
char char * val
Definition: IpStdCInterface.h:189
keyword
char * keyword
Definition: IpStdCInterface.h:189
eval_jac_g
Number Number Index Number Number Index Index Index Eval_F_CB Eval_G_CB Eval_Grad_F_CB Eval_Jac_G_CB eval_jac_g
Callback function for evaluating Jacobian of constraint functions.
Definition: IpStdCInterface.h:137
nele_jac
Number Number Index Number Number Index nele_jac
Number of non-zero elements in constraint Jacobian.
Definition: IpStdCInterface.h:137
mult_x_U
Number Number Number Number Number Number * mult_x_U
Input: Initial values for the multipliers for upper variable bounds (only if warm start option is cho...
Definition: IpStdCInterface.h:238
eval_g
Number Number Index Number Number Index Index Index Eval_F_CB Eval_G_CB eval_g
Callback function for evaluating constraint functions.
Definition: IpStdCInterface.h:137
x_L
Number * x_L
Lower bounds on variables.
Definition: IpStdCInterface.h:137
g_L
Number Number Index Number * g_L
Lower bounds on constraints.
Definition: IpStdCInterface.h:137
mult_g
Number Number Number Number * mult_g
Input: Initial values for the constraint multipliers (only if warm start option is chosen) Output: Fi...
Definition: IpStdCInterface.h:238
x_U
Number Number * x_U
Upper bounds on variables.
Definition: IpStdCInterface.h:137
mult_x_L
Number Number Number Number Number * mult_x_L
Input: Initial values for the multipliers for lower variable bounds (only if warm start option is cho...
Definition: IpStdCInterface.h:238
x_scaling
Number Number * x_scaling
Definition: IpStdCInterface.h:210
Eval_Jac_G_CB
Bool(* Eval_Jac_G_CB)(Index n, Number *x, Bool new_x, Index m, Index nele_jac, Index *iRow, Index *jCol, Number *values, UserDataPtr user_data)
Type defining the callback function for evaluating the Jacobian of the constrant functions.
Definition: IpStdCInterface.h:88
Number
double Number
Type for all number.
Definition: IpStdCInterface.h:33
nele_hess
Number Number Index Number Number Index Index nele_hess
Number of non-zero elements in Hessian of Lagrangian.
Definition: IpStdCInterface.h:137
g_scaling
Number Number Number * g_scaling
Definition: IpStdCInterface.h:210
file_name
char * file_name
Definition: IpStdCInterface.h:202
Eval_G_CB
Bool(* Eval_G_CB)(Index n, Number *x, Bool new_x, Index m, Number *g, UserDataPtr user_data)
Type defining the callback function for evaluating the value of the constraint functions.
Definition: IpStdCInterface.h:82
UserDataPtr
void * UserDataPtr
A pointer for anything that is to be passed between the called and individual callback function...
Definition: IpStdCInterface.h:65
ApplicationReturnStatus
ApplicationReturnStatus
Return codes for the Optimize call for an application.
Definition: IpReturnCodes_inc.h:16
Eval_H_CB
Bool(* Eval_H_CB)(Index n, Number *x, Bool new_x, Number obj_factor, Index m, Number *lambda, Bool new_lambda, Index nele_hess, Index *iRow, Index *jCol, Number *values, UserDataPtr user_data)
Type defining the callback function for evaluating the Hessian of the Lagrangian function.
Definition: IpStdCInterface.h:96
user_data
Number Number Number Number Number Number UserDataPtr user_data
Pointer to user data.
Definition: IpStdCInterface.h:238
obj_scaling
Number obj_scaling
Definition: IpStdCInterface.h:210
intermediate_cb
Intermediate_CB intermediate_cb
Definition: IpStdCInterface.h:224
eval_f
Number Number Index Number Number Index Index Index Eval_F_CB eval_f
Callback function for evaluating objective function.
Definition: IpStdCInterface.h:137
IPOPT_EXPORT
#define IPOPT_EXPORT(type)
Definition: IpIpoptApplication.hpp:20