CPLEX Using the Matlab Interface

From TomWiki
Jump to navigationJump to search

Notice.png

This page is part of the CPLEX Manual. See CPLEX.

The two main routines in the two-layer design of the interface are shown in #Table: The interface routines.. Page and section references are given to detailed descriptions on how to use the routines. Users not using the TOMLAB Prob format can skip reading about the routine cplexTL. A normal user, not using callbacks, only has to read about how to call the level 1 interface routine cplex.m.

Table: The interface routines.

Function Description
cplex The layer one Matlab interface routine, calls the MEX-file interface cplexmex.dll.
cplexTL The layer two TOMLAB interface routine that calls cplex.m. Converts the input Prob format before calling cplex.m and converts back to the output Result structure.

The CPLEX control parameters are all possible to set from Matlab.

They could be set as input to the interface routine cplex, but also in the callback routines. The user sets fields in a structure called cpxControl, where the subfield names are the same as the names of the control variables. The following example shows how to set the values for one integer variable ITLIM, one double variable EPOPT, and one character variable valued variable WORKDIR. TOMLAB /CPLEX does not use the prefix CPX_PARAM in the Matlab structures.

cpxControl.ITLIM         = 50;      % Setting maximal number of simplex iterations
cpxControl.EPOPT         = 1E-5;    % Changing reduced cost tolerance
cpxControl.WORKDIR       = '.';     % New work directory ( '.' for current directory)

Character valued variables should have = 64 characters.