- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

# /home/coin/SVN-release/Ipopt-3.2.1/Ipopt/src/Interfaces/IpStdCInterface.h

Go to the documentation of this file.

    00001 /*************************************************************************
    00002    Copyright (C) 2004, 2006 International Business Machines and others.
    00003    All Rights Reserved.
    00004    This code is published under the Common Public License.
    00005
    00006    $Id: IpStdCInterface.h 759 2006-07-07 03:07:08Z andreasw $
    00007
    00008    Authors:  Carl Laird, Andreas Waechter     IBM    2004-09-02
    00009  *************************************************************************/
    00010
    00011 #ifndef __IPSTDCINTERFACE_H__
    00012 #define __IPSTDCINTERFACE_H__
    00013
    00014 #ifdef __cplusplus
    00015 extern "C"
    00016 {
    00017 #endif
    00018
    00021   typedef double Number;
    00022
    00025   typedef int Index;
    00026
    00029   typedef int Int;
    00030
    00031   /* This includes the SolverReturn enum type */
    00032 #include "IpReturnCodes.h"
    00033
    00037   struct IpoptProblemInfo;
    00038
    00040   typedef struct IpoptProblemInfo* IpoptProblem;
    00041
    00043   typedef int Bool;
    00044 #ifndef TRUE
    00045 # define TRUE (1)
    00046 #endif
    00047 #ifndef FALSE
    00048 # define FALSE (0)
    00049 #endif
    00050
    00053   typedef void * UserDataPtr;
    00054
    00058   typedef Bool (*Eval_F_CB)(Index n, Number* x, Bool new_x,
    00059                             Number* obj_value, UserDataPtr user_data);
    00060
    00064   typedef Bool (*Eval_Grad_F_CB)(Index n, Number* x, Bool new_x,
    00065                                  Number* grad_f, UserDataPtr user_data);
    00066
    00070   typedef Bool (*Eval_G_CB)(Index n, Number* x, Bool new_x,
    00071                             Index m, Number* g, UserDataPtr user_data);
    00072
    00076   typedef Bool (*Eval_Jac_G_CB)(Index n, Number *x, Bool new_x,
    00077                                 Index m, Index nele_jac,
    00078                                 Index *iRow, Index *jCol, Number *values,
    00079                                 UserDataPtr user_data);
    00080
    00084   typedef Bool (*Eval_H_CB)(Index n, Number *x, Bool new_x, Number obj_factor,
    00085                             Index m, Number *lambda, Bool new_lambda,
    00086                             Index nele_hess, Index *iRow, Index *jCol,
    00087                             Number *values, UserDataPtr user_data);
    00088
    00100   IpoptProblem CreateIpoptProblem(
    00101       Index n
    00102     , Number* x_L
    00110     , Number* x_U
    00118     , Index m
    00119     , Number* g_L
    00127     , Number* g_U
    00135     , Index nele_jac
    00137     , Index nele_hess
    00139     , Index index_style
    00141     , Eval_F_CB eval_f
    00143     , Eval_G_CB eval_g
    00145     , Eval_Grad_F_CB eval_grad_f
    00148     , Eval_Jac_G_CB eval_jac_g
    00151     , Eval_H_CB eval_h
    00153   );
    00154
    00157   void FreeIpoptProblem(IpoptProblem ipopt_problem);
    00158
    00159
    00162   Bool AddIpoptStrOption(IpoptProblem ipopt_problem, char* keyword, char* val);
    00163
    00166   Bool AddIpoptNumOption(IpoptProblem ipopt_problem, char* keyword, Number val);
    00167
    00170   Bool AddIpoptIntOption(IpoptProblem ipopt_problem, char* keyword, Int val);
    00171
    00175   Bool OpenIpoptOutputFile(IpoptProblem ipopt_problem, char* file_name,
    00176                            Int print_level);
    00177
    00183   enum ApplicationReturnStatus IpoptSolve(
    00184       IpoptProblem ipopt_problem
    00188     , Number* x
    00190     , Number* g
    00192     , Number* obj_val
    00194     , Number* mult_g
    00196     , Number* mult_x_L
    00198     , Number* mult_x_U
    00200     , UserDataPtr user_data
    00204   );
    00205
    00211 #ifdef __cplusplus
    00212 } /* extern "C" { */
    00213 #endif
    00214
    00215 #endif