• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

/tmp/buildd/coinor-ipopt-3.8.3/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 1586 2009-10-27 15:55:03Z 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 
00112   IPOPT_EXPORT(IpoptProblem) CreateIpoptProblem(
00113       Index n             
00114     , Number* x_L         
00122     , Number* x_U         
00130     , Index m             
00131     , Number* g_L         
00139     , Number* g_U         
00147     , Index nele_jac      
00149     , Index nele_hess     
00151     , Index index_style   
00153     , Eval_F_CB eval_f    
00155     , Eval_G_CB eval_g    
00157     , Eval_Grad_F_CB eval_grad_f
00160     , Eval_Jac_G_CB eval_jac_g
00163     , Eval_H_CB eval_h    
00165   );
00166 
00169   IPOPT_EXPORT(void) FreeIpoptProblem(IpoptProblem ipopt_problem);
00170 
00171 
00174   IPOPT_EXPORT(Bool) AddIpoptStrOption(IpoptProblem ipopt_problem, char* keyword, char* val);
00175 
00178   IPOPT_EXPORT(Bool) AddIpoptNumOption(IpoptProblem ipopt_problem, char* keyword, Number val);
00179 
00182   IPOPT_EXPORT(Bool) AddIpoptIntOption(IpoptProblem ipopt_problem, char* keyword, Int val);
00183 
00187   IPOPT_EXPORT(Bool) OpenIpoptOutputFile(IpoptProblem ipopt_problem, char* file_name,
00188                            Int print_level);
00189 
00194   IPOPT_EXPORT(Bool) SetIpoptProblemScaling(IpoptProblem ipopt_problem,
00195                               Number obj_scaling,
00196                               Number* x_scaling,
00197                               Number* g_scaling);
00198 
00204   IPOPT_EXPORT(enum ApplicationReturnStatus) IpoptSolve(
00205       IpoptProblem ipopt_problem
00209     , Number* x          
00211     , Number* g          
00213     , Number* obj_val    
00215     , Number* mult_g     
00217     , Number* mult_x_L   
00219     , Number* mult_x_U   
00221     , UserDataPtr user_data
00225   );
00226 
00231 #ifdef __cplusplus
00232 } /* extern "C" { */
00233 #endif
00234 
00235 #endif

Generated on Thu Jul 29 2010 19:56:08 by  doxygen 1.7.1