12.07.2015 Views

ILOG CPLEX 11.0 User's Manual

ILOG CPLEX 11.0 User's Manual

ILOG CPLEX 11.0 User's Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

whether an optimization should be aborted. CPXgetcallbackinfo and certain othercallback-specific routines are the only ones of the Callable Library that a user-definedcallback may call. (Of course, calls to routines not in the Callable Library are permitted.)Using Optimization Callbacks on page 445 explores callback facilities in greater detail, andAdvanced MIP Control Interface on page 483 discusses control callbacks in particular.Portability<strong>ILOG</strong> <strong>CPLEX</strong> contains a number of features to help you create Callable Libraryapplications that can be easily ported between UNIX and Windows platforms.CPXPUBLICAll <strong>ILOG</strong> <strong>CPLEX</strong> Callable Library routines except CPXmsg have the word CPXPUBLIC aspart of their prototype. On UNIX platforms, this has no effect. On Win32 platforms, theCPXPUBLIC designation tells the compiler that all of the <strong>ILOG</strong> <strong>CPLEX</strong> functions arecompiled with the Microsoft __stdcall calling convention. The exception CPXmsg cannotbe called by __stdcall because it takes a variable number of arguments. Consequently,CPXmsg is declared as CPXPUBVARARGS; that calling convention is defined as __cdecl forWin32 systems.Function PointersAll <strong>ILOG</strong> <strong>CPLEX</strong> Callable Library routines that require pointers to functions expect thepassed-in pointers to be declared as CPXPUBLIC. Consequently, when your application usessuch routines as CPXaddfuncdest, CPXsetlpcallbackfunc, andCPXsetmipcallbackfunc, it must declare the user-written callback functions with theCPXPUBLIC designation. For UNIX systems, this has no effect. For Win32 systems, this willcause the callback functions to be declared with the __stdcall calling convention. Forexamples of function pointers and callbacks, see Example: Using Callbacks lpex4.c onpage 461 and Example: Callable Library Message Channels on page 152.CPXCHARptr, CPXCCHARptr, and CPXVOIDptrThe types CPXCHARptr, CPXCCHARptr, and CPXVOIDptr are used in the header filecplex.h to avoid the complicated syntax of using the CPXPUBLIC designation on functionsthat return char*, const char*, or void*.File PointersFile pointer arguments for Callable Library routines should be declared with the typeCPXFILEptr. On UNIX platforms, this practice is equivalent to using the file pointer type.On Win32 platforms, the file pointers declared this way will correspond to the environmentof the <strong>ILOG</strong> <strong>CPLEX</strong> DLL. Any file pointer passed to a Callable Library routine should beobtained with a call to CPXfopen and closed with CPXfclose. Callable Library routineswith file pointer arguments include CPXsetlogfile, CPXaddfpdest, CPXdelfpdest,<strong>ILOG</strong> <strong>CPLEX</strong> <strong>11.0</strong> — USER’ S MANUAL 121

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!