> Languages and APIs > The ILOG CPLEX Callable Library > Managing Parameters from the Callable Library |
Managing Parameters from the Callable Library |
INDEX PREVIOUS NEXT |
Some ILOG CPLEX parameters assume values of type double
; others assume values of type 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 to change parameters that control the ILOG CPLEX environment and guide optimization.
For example, the routine CPXinfointparam
shows you the default, the maximum, and the minimum values of a given parameter of type int
, whereas the routine CPXinfodblparam
shows you the default, the maximum, and the minimum values of a given parameter of type double
, and the routine CPXinfostrparam
shows you the default value of a given string parameter. Those three Callable Library routines observe the same conventions: they return 0
(zero) from a successful call and a nonzero value in case of error.
The routines CPXinfointparam
and CPXinfodblparam
expect five arguments:
CPXENVptr
returned by CPXopenCPLEX
;
CPX_PARAM_CLOCKTYPE,
or a reference number, such as 1006
; the symbolic constants and reference numbers of all ILOG CPLEX parameters are documented in the reference manual ILOG CPLEX Parameters and they are defined in the include file cplex.h
.
The routine CPXinfostrparam
differs slightly in that it does not expect pointers to variables to hold the minimum and maximum values as those concepts do not apply to a string parameter.
To access the current value of a parameter that interests you from the Callable Library, use the routine CPXgetintparam
for parameters of type int
, CPXgetdblparam
for parameters of type double
, and CPXgetstrparam
for string parameters. These routines also expect arguments to indicate the environment, the parameter you want to check, and a pointer to a variable to hold that current value.
No doubt you have noticed in other chapters of this manual that you can set parameters from the Callable Library. There are, of course, routines in the Callable Library to set such parameters: one sets parameters of type int
; another sets parameters of type double
; another sets string parameters.
CPXsetintparam
accepts arguments to indicate:
CPXENVptr
returned by CPXopenCPLEX
;
int
;
CPXsetdblparam
accepts arguments to indicate:
CPXENVptr
returned by CPXopenCPLEX
;
double
;
CPXsetstrparam
accepts arguments to indicate:
CPXENVptr
returned by CPXopenCPLEX
;
char*
;
The reference manual ILOG CPLEX Parameters documents the type of each parameter (int
, double
, char*
) along with the symbolic constant and reference number representing the parameter.
The routine CPXsetdefaults
resets all parameters (except the log file) to their default values, including the ILOG CPLEX callback functions. This routine resets the callback functions to NULL
. Like other Callable Library routines to manage parameters, this one accepts an argument indicating the environment, and it returns 0
for success or a nonzero value in case of error.
Copyright © 1987-2003 ILOG, S.A. All rights reserved. Legal terms. | PREVIOUS NEXT |