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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Callable Library have names greater than six characters, you need to verify whether yourFORTRAN compiler enforces this limit or allows longer identifiers.Call by ReferenceBy default, FORTRAN passes arguments by reference; that is, the address of a variable ispassed to a routine, not its value. In contrast, many routines of the Callable Library requirearguments passed by value. To accommodate those routines, most FORTRAN compilershave the VMS FORTRAN extension %VAL(). This operator used in calls to externalfunctions or subroutines causes its argument to be passed by value (rather than by the defaultFORTRAN convention of passed by reference). For example, with that extension, you cancall the routine CPXprimopt with this FORTRAN statement:status = CPXprimopt (%val(env), %val(lp))PointersCertain <strong>ILOG</strong> <strong>CPLEX</strong> routines return a pointer to memory. In FORTRAN 77, such a pointercannot be dereferenced; however, you can store its value in an appropriate integer type, andyou can then pass it to other <strong>ILOG</strong> <strong>CPLEX</strong> routines. On most operating systems, the defaultinteger type of four bytes is sufficient to hold pointer variables. On some systems, a variableof type INTEGER*8 may be needed. Consult your system documentation to learn theappropriate integer type to hold variables that are C pointers.StringsWhen you pass strings to routines of the Callable Library, they expect C strings; that is,strings terminated by an ASCII NULL character, denoted \0 in C. Consequently, when youpass a FORTRAN string, you must add a terminating NULL character; you do so by means ofthe FORTRAN intrinsic function CHAR(0).C++ InterfaceThe <strong>ILOG</strong> <strong>CPLEX</strong> header file, cplex.h, includes the extern C statements necessary foruse with C++. If you wish to call the <strong>ILOG</strong> <strong>CPLEX</strong> C interface from a C++ application,rather than using Concert Technology, you can include cplex.h in your C++ source.Managing Parameters from the Callable LibrarySome <strong>ILOG</strong> <strong>CPLEX</strong> parameters assume values of type double; others assume values oftype int; others are strings (that is, C-type char*). Consequently, in the Callable Library,there are sets of routines (one for int, one for double, one for char*) to access and tochange parameters that control the <strong>ILOG</strong> <strong>CPLEX</strong> environment and guide optimization.For example, the routine CPXinfointparam shows you the default, the maximum, and theminimum values of a given parameter of type int, whereas the routine CPXinfodblparam<strong>ILOG</strong> <strong>CPLEX</strong> <strong>11.0</strong> — USER’ S MANUAL 123

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

Saved successfully!

Ooh no, something went wrong!