Xpress Using the Matlab Interface: Difference between revisions

From TomWiki
Jump to navigationJump to search
(Created page with "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. Th...")
 
No edit summary
Line 1: Line 1:
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''.
The two main routines in the two-layer design of the interface are shown in <xr id="tab:interfaceRoutines" />. 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''.


<figtable id="interfaceRoutines">
<figtable id="tab:interfaceRoutines">
{|class="wikitable"
{|class="wikitable"
|+<caption>The interface routines.</caption>
|+<caption>The interface routines.</caption>
Line 12: Line 12:
</figtable>
</figtable>


The Xpress<sup>''MP''</sup> 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.
The Xpress<sup>''MP''</sup> control variables, see [[Xpress xpControl]], 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.


<pre>
<pre>

Revision as of 08:07, 28 September 2011

The two main routines in the two-layer design of the interface are shown in <xr id="tab:interfaceRoutines" />. 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.

<figtable id="tab:interfaceRoutines">

The interface routines.
Function Description
xpress The layer one Matlab interface routine, calls the MEX-file interface xpressmp.dll
xpressTL The layer two TOMLAB interface routine that calls xpress.m. Con- verts the input P rob format before calling xpress.m and converts back to the output Result structure.

</figtable>

The XpressMP control variables, see Xpress xpControl, 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.

apcontrol.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 Xpress MP interface, two global variables are available, xpControlVariables and xpProblemAttrib. As subfields they hold the current values of all Xpress MP control variables, and all problem attributes. To list all their fields, just define the variables as global and give their names

global xpControlVariables xpProblemAttrib 
xpControlVariables
xpProblemAttrib