# TOMLAB  
# REGISTER (TOMLAB)
# LOGIN  
# myTOMLAB
TOMLAB LOGO

« Previous « Start » Next »

3  Using the Matlab Interface

The two main routines in the two-layer design of the interface are shown in Table 1. Page and section references are given to detailed descriptions on how to use the routines. The user that is not using TOMLAB can skip reading about the routine xpressTL. A normal user, not using callbacks, only has to read about how to call the level 1 interface routine xpress.




Table 1: The interface routines.


Function Description Section
xpress The layer one Matlab interface routine, calls the MEX-file interface xpressmp.dll A.1
xpressTL The layer two TOMLAB interface routine that calls xpress.m. Converts the input Prob format before calling xpress.m and converts back to the output Result structure. A.2

The XpressMP control variables, see Section 7 in the Xpress-Optimizer Reference Manual [1], are all possible to set from Matlab. They could be set as input to the interface routine xpress, but also in the callback routines. The user sets fields in a structure called xpcontrol, 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 XPRS_LPITERLIMIT, one double variable XPRS_OPTIMALITYTOL, and one character variable valued variable XPRS_OBJNAME. TOMLAB /Xpress does not use the prefix XPRS_ in the Matlab structures.
xpcontrol.LPITERLIMIT   = 50;      % Setting maximal number of global iterations
xpcontrol.OPTIMALITYTOL = 1E-5;    % Changing reduced cost tolerance
xpcontrol.OBJNAME       = 'ObjF1'; % New name of the objective function
Character valued variables should have ≤ 64 characters.

Note that after the call to the XpressMP interface, two global variables are available, xpControlVariables and xpProblemAttrib. As subfields they hold the current values of all XpressMP control variables see Section 7 in [1], and all problem attributes, see Section 8 in [1]. To list all their fields, just define the variables as global and give their names
global xpControlVariables xpProblemAttrib
xpControlVariables
xpProblemAttrib

« Previous « Start » Next »