- Main Page
- Classes
- Files

- File List
- File Members

# src/Interfaces/IpStdCInterface.h

Go to the documentation of this file.

    00001 /*************************************************************************
    00002    Copyright (C) 2004, 2010 International Business Machines and others.
    00003    All Rights Reserved.
    00004    This code is published under the Eclipse Public License.
    00005
    00006    $Id: IpStdCInterface.h 2082 2012-02-16 03:00:34Z andreasw $
    00007
    00008    Authors:  Carl Laird, Andreas Waechter     IBM    2004-09-02
    00009  *************************************************************************/
    00010
    00011 #ifndef __IPSTDCINTERFACE_H__
    00012 #define __IPSTDCINTERFACE_H__
    00013
    00014 #ifndef IPOPT_EXPORT
    00015 #ifdef _MSC_VER
    00016 #ifdef IPOPT_DLL
    00017 #define IPOPT_EXPORT(type) __declspec(dllexport) type __cdecl
    00018 #else
    00019 #define IPOPT_EXPORT(type) type __cdecl
    00020 #endif
    00021 #else
    00022 #define IPOPT_EXPORT(type) type
    00023 #endif
    00024 #endif
    00025
    00026 #ifdef __cplusplus
    00027 extern "C"
    00028 {
    00029 #endif
    00030
    00033   typedef double Number;
    00034
    00037   typedef int Index;
    00038
    00041   typedef int Int;
    00042
    00043   /* This includes the SolverReturn enum type */
    00044 #include "IpReturnCodes.h"
    00045
    00049   struct IpoptProblemInfo;
    00050
    00052   typedef struct IpoptProblemInfo* IpoptProblem;
    00053
    00055   typedef int Bool;
    00056 #ifndef TRUE
    00057 # define TRUE (1)
    00058 #endif
    00059 #ifndef FALSE
    00060 # define FALSE (0)
    00061 #endif
    00062
    00065   typedef void * UserDataPtr;
    00066
    00070   typedef Bool (*Eval_F_CB)(Index n, Number* x, Bool new_x,
    00071                             Number* obj_value, UserDataPtr user_data);
    00072
    00076   typedef Bool (*Eval_Grad_F_CB)(Index n, Number* x, Bool new_x,
    00077                                  Number* grad_f, UserDataPtr user_data);
    00078
    00082   typedef Bool (*Eval_G_CB)(Index n, Number* x, Bool new_x,
    00083                             Index m, Number* g, UserDataPtr user_data);
    00084
    00088   typedef Bool (*Eval_Jac_G_CB)(Index n, Number *x, Bool new_x,
    00089                                 Index m, Index nele_jac,
    00090                                 Index *iRow, Index *jCol, Number *values,
    00091                                 UserDataPtr user_data);
    00092
    00096   typedef Bool (*Eval_H_CB)(Index n, Number *x, Bool new_x, Number obj_factor,
    00097                             Index m, Number *lambda, Bool new_lambda,
    00098                             Index nele_hess, Index *iRow, Index *jCol,
    00099                             Number *values, UserDataPtr user_data);
    00100
    00108   typedef Bool (*Intermediate_CB)(Index alg_mod, /* 0 is regular, 1 is resto */
    00109                   Index iter_count, Number obj_value,
    00110                   Number inf_pr, Number inf_du,
    00111                   Number mu, Number d_norm,
    00112                   Number regularization_size,
    00113                   Number alpha_du, Number alpha_pr,
    00114                   Index ls_trials, UserDataPtr user_data);
    00115
    00127   IPOPT_EXPORT(IpoptProblem) CreateIpoptProblem(
    00128       Index n
    00129     , Number* x_L
    00137     , Number* x_U
    00145     , Index m
    00146     , Number* g_L
    00154     , Number* g_U
    00162     , Index nele_jac
    00164     , Index nele_hess
    00166     , Index index_style
    00168     , Eval_F_CB eval_f
    00170     , Eval_G_CB eval_g
    00172     , Eval_Grad_F_CB eval_grad_f
    00175     , Eval_Jac_G_CB eval_jac_g
    00178     , Eval_H_CB eval_h
    00180   );
    00181
    00184   IPOPT_EXPORT(void) FreeIpoptProblem(IpoptProblem ipopt_problem);
    00185
    00186
    00189   IPOPT_EXPORT(Bool) AddIpoptStrOption(IpoptProblem ipopt_problem, char* keyword, char* val);
    00190
    00193   IPOPT_EXPORT(Bool) AddIpoptNumOption(IpoptProblem ipopt_problem, char* keyword, Number val);
    00194
    00197   IPOPT_EXPORT(Bool) AddIpoptIntOption(IpoptProblem ipopt_problem, char* keyword, Int val);
    00198
    00202   IPOPT_EXPORT(Bool) OpenIpoptOutputFile(IpoptProblem ipopt_problem, char* file_name,
    00203                            Int print_level);
    00204
    00209   IPOPT_EXPORT(Bool) SetIpoptProblemScaling(IpoptProblem ipopt_problem,
    00210                   Number obj_scaling,
    00211                   Number* x_scaling,
    00212                   Number* g_scaling);
    00213
    00223   IPOPT_EXPORT(Bool) SetIntermediateCallback(IpoptProblem ipopt_problem,
    00224                          Intermediate_CB intermediate_cb);
    00225
    00231   IPOPT_EXPORT(enum ApplicationReturnStatus) IpoptSolve(
    00232       IpoptProblem ipopt_problem
    00236     , Number* x
    00238     , Number* g
    00240     , Number* obj_val
    00242     , Number* mult_g
    00247     , Number* mult_x_L
    00252     , Number* mult_x_U
    00257     , UserDataPtr user_data
    00261   );
    00262
    00267 #ifdef __cplusplus
    00268 } /* extern "C" { */
    00269 #endif
    00270
    00271 #endif

All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines