Xpress Appendix B: Difference between revisions
(Created page with "==Appendix B - The Matlab Interface Routines - Utility Routines== ==xpr2mat== ===Purpose=== xpr2mat reads an (X)MPS file and more. The file is converted to matrices and vector...") |
No edit summary |
||
Line 1: | Line 1: | ||
== | {{Part Of Manual|title=the Xpress Manual|link=[[Xpress|Xpress Manual]]}} | ||
==The Matlab Interface Routines - Utility Routines== | |||
==xpr2mat== | ===xpr2mat=== | ||
===Purpose=== | ====Purpose==== | ||
xpr2mat reads an (X)MPS file and more. The file is converted to matrices and vectors made available in MATLAB. MPS and extended MPS for LP, MILP, QP and MIQP are the supported file types, however it is possible to supply a wide range of file types. | xpr2mat reads an (X)MPS file and more. The file is converted to matrices and vectors made available in MATLAB. MPS and extended MPS for LP, MILP, QP and MIQP are the supported file types, however it is possible to supply a wide range of file types. | ||
===Calling Syntax=== | ====Calling Syntax==== | ||
<pre> | <pre> | ||
[F, c, A, | [F, c, A, b_L, b_U, x_L, x_U, IntVars] = xpr2mat(Name, PriLev, FreeRows); | ||
</pre> | </pre> | ||
===Description of Input=== | ====Description of Input==== | ||
{|class="wikitable" | {|class="wikitable" | ||
Line 25: | Line 26: | ||
|} | |} | ||
===Description | ====Description of Output==== | ||
{|class="wikitable" | {|class="wikitable" | ||
Line 47: | Line 48: | ||
|} | |} | ||
==abc2gap== | ===abc2gap=== | ||
===Purpose=== | ====Purpose==== | ||
Converting a general assignment problem (GAP) to a standard form suitable for a MIP solver. | Converting a general assignment problem (GAP) to a standard form suitable for a MIP solver. | ||
Line 73: | Line 74: | ||
</math> | </math> | ||
===Calling Syntax== | ====Calling Syntax==== | ||
<pre> | <pre> | ||
Line 79: | Line 80: | ||
</pre> | </pre> | ||
===Description of Input=== | ====Description of Input==== | ||
{|class="wikitable" | {|class="wikitable" | ||
Line 89: | Line 90: | ||
|''C''||A ''m × n ''cost matrix for GAP constraints. | |''C''||A ''m × n ''cost matrix for GAP constraints. | ||
|-valign="top" | |-valign="top" | ||
|''SOS1''||Logical variable, default false. If true, generate output for sos1 handling with Xpress '' | |''SOS1''||Logical variable, default false. If true, generate output for sos1 handling with Xpress<sup>''M P''</sup> | ||
Otherwise generate output giving an equivalent formulation with standard integer variables. | Otherwise generate output giving an equivalent formulation with standard integer variables. | ||
|} | |} | ||
===Description | ====Description of Output==== | ||
{|class="wikitable" | {|class="wikitable" | ||
Line 109: | Line 110: | ||
|''a''||Sparse ''m ''+ ''n × m * n ''matrix for linear constraints. | |''a''||Sparse ''m ''+ ''n × m * n ''matrix for linear constraints. | ||
|-valign="top" | |-valign="top" | ||
|''sos1''||If input variable ''SOS''1 is true, structure with sos1 variable information in the form suitable | |''sos1''||If input variable ''SOS''1 is true, structure with sos1 variable information in the form suitable for the Matlab Xpress<sup>''M P''</sup> interface routine ''xpress'', otherwise empty. | ||
for the Matlab Xpress''M P | |||
|} | |} | ||
===Description=== | ====Description==== | ||
Converting a general assignment problem (GAP) to standard form suitable for a mixed-integer programming solver. Either binary or sos1 variables are used. | Converting a general assignment problem (GAP) to standard form suitable for a mixed-integer programming solver. Either binary or sos1 variables are used. | ||
==xp2control== | ===xp2control=== | ||
===Purpose=== | ====Purpose==== | ||
Xpress''M P | Xpress<sup>''M P''</sup> Matlab MEX-interface internal callback routine | ||
===Calling Syntax=== | ====Calling Syntax==== | ||
<pre> | <pre> | ||
Line 130: | Line 129: | ||
</pre> | </pre> | ||
===Description of Input=== | ====Description of Input==== | ||
{|class="wikitable" | {|class="wikitable" | ||
|''xpicv''||Vector of doubles with Xpress'' | |''xpicv''||Vector of doubles with Xpress<sup>''M P''</sup> Integer Control Variables. | ||
|-valign="top" | |||
|''xpdcv''||Vector of doubles with Xpress<sup>''M P''</sup> Double Control Variables. | |||
|-valign="top" | |||
|''xpccv1''||String with 1st Xpress<sup>''M P''</sup> String Control Variable. | |||
|-valign="top" | |||
|''xpccv2''||String with 2nd Xpress<sup>''M P''</sup> String Control Variable. | |||
|-valign="top" | |||
|''xpccv3''||String with 3rd Xpress<sup>''M P''</sup> String Control Variable. | |||
|-valign="top" | |-valign="top" | ||
|'' | |''xpccv4''||String with 4th Xpress<sup>''M P''</sup> String Control Variable. | ||
|-valign="top" | |-valign="top" | ||
|'' | |''xpccv5''||String with 5th Xpress<sup>''M P''</sup> String Control Variable. | ||
|-valign="top" | |-valign="top" | ||
|''xpccv6''||String with 6th Xpress '' | |''xpccv6''||String with 6th Xpress<sup>''M P''</sup> String Control Variable. | ||
|} | |} | ||
===Global Parameters Used=== | ====Global Parameters Used==== | ||
{|class="wikitable" | {|class="wikitable" | ||
!Parameter||Description | !Parameter||Description | ||
|-valign="top" | |-valign="top" | ||
|''xpControlVariables''||Structure with all Xpress''MP'' control variables. Set before the callback. | |''xpControlVariables''||Structure with all Xpress<sup>''MP''</sup> control variables. Set before the callback. | ||
|} | |} | ||
=== | ====Description==== | ||
Xpress ''MP'' Matlab MEX-interface internal callback routine. Creates a global Matlab structure variable xpCon- trolVariables, where the fields corresponds to the Xpress''M P | Xpress<sup>''MP''</sup> Matlab MEX-interface internal callback routine. Creates a global Matlab structure variable xpCon- trolVariables, where the fields corresponds to the Xpress<sup>''M P''</sup> control variable names as given in Section 7 in the Xpress-Optimizer Reference Manual. | ||
==xp2problem== | ===xp2problem=== | ||
===Purpose=== | ====Purpose==== | ||
Xpress ''MP'' Matlab MEX-interface internal callback routine | Xpress<sup>''MP''</sup> Matlab MEX-interface internal callback routine | ||
===Calling Syntax=== | ====Calling Syntax==== | ||
<pre> | <pre> | ||
Line 166: | Line 173: | ||
</pre> | </pre> | ||
===Description | ====Description of Input==== | ||
{|class="wikitable" | {|class="wikitable" | ||
!Input||Description | !Input||Description | ||
|-valign="top" | |-valign="top" | ||
|''xpipv''||Vector of doubles with Xpress''M P | |''xpipv''||Vector of doubles with Xpress<sup>''M P''</sup> Integer Problem Variables. | ||
|-valign="top" | |-valign="top" | ||
|''xpdpv''||Vector of doubles with Xpress''M P | |''xpdpv''||Vector of doubles with Xpress<sup>''M P''</sup> Double Problem Variables. | ||
|-valign="top" | |-valign="top" | ||
|''xpcpv1''||String with 1st Xpress '' | |''xpcpv1''||String with 1st Xpress<sup>''M P''</sup> String Problem Variable. | ||
|-valign="top" | |-valign="top" | ||
|''xpcpv2''||String with 2nd Xpress '' | |''xpcpv2''||String with 2nd Xpress<sup>''M P''</sup> String Problem Variable. | ||
|-valign="top" | |-valign="top" | ||
|''xpcpv3''||String with 3rd Xpress '' | |''xpcpv3''||String with 3rd Xpress<sup>''M P''</sup> String Problem Variable. | ||
|-valign="top" | |-valign="top" | ||
|''xpcpv4''||String with 4th Xpress'' | |''xpcpv4''||String with 4th Xpress<sup>''M P''</sup> String Problem Variable. | ||
|-valign="top" | |-valign="top" | ||
|''xpcpv5''||String with 5th Xpress '' | |''xpcpv5''||String with 5th Xpress<sup>''M P''</sup> String Problem Variable. | ||
|} | |} | ||
==Global Parameters Used== | ====Global Parameters Used==== | ||
{|class="wikitable" | {|class="wikitable" | ||
!Parameter||Description | !Parameter||Description | ||
|-valign="top" | |-valign="top" | ||
|''xpProblemAttrib''||Structure with all Xpress '' | |''xpProblemAttrib''||Structure with all Xpress<sup>''M P''</sup> problem attributes listed in Section 8 in the Xpress-Optimizer Reference Manual. Set before the callback. | ||
|} | |} | ||
===Description=== | ====Description==== | ||
Xpress '' | Xpress<sup>''M P''</sup> Matlab MEX-interface internal callback routine. Creates a global Matlab structure variable xpProb- lemAttrib, where the fields corresponds to the Xpress<sup>''M P''</sup> problem attribute names. |
Latest revision as of 08:39, 3 October 2011
This page is part of the Xpress Manual. See Xpress Manual. |
The Matlab Interface Routines - Utility Routines
xpr2mat
Purpose
xpr2mat reads an (X)MPS file and more. The file is converted to matrices and vectors made available in MATLAB. MPS and extended MPS for LP, MILP, QP and MIQP are the supported file types, however it is possible to supply a wide range of file types.
Calling Syntax
[F, c, A, b_L, b_U, x_L, x_U, IntVars] = xpr2mat(Name, PriLev, FreeRows);
Description of Input
Input | Description |
---|---|
Name | Name of the MPS file without extension. xpr2mat can recognize many different file extensions, e.g.: .mps, .lp, .mat, .qps. |
PriLev | Print level of cpx2mat. Set to 0 to have it silent, 1 to print warnings, and 2 to print debug information. |
FreeRows | Set to 1 to delete free rows. 0 leaves the free rows. Default: 1. |
Description of Output
Output | Description |
---|---|
F | The quadratic term matrix. Empty for non-QP problems. |
c | The linear term vector. |
A | The constraint matrix. |
b_L | The lower bounds of the constraints. |
b_U | The upper bounds of the constraints. |
x_L | The lower box bounds of x. |
x_U | The upper box bounds of x. |
IntVars | Logical vector describing what variables that are integer or binary variables. Empty if the problem is not a mixed integer problem. |
abc2gap
Purpose
Converting a general assignment problem (GAP) to a standard form suitable for a MIP solver.
The GAP problem is formulated as
Calling Syntax
[c, x L, x U, b L, b U, a, sos1] = abc2gap( A, b, C, SOS1);
Description of Input
A | A m × n constraint matrix for GAP constraints. |
b | A m × 1 right hand side vector. |
C | A m × n cost matrix for GAP constraints. |
SOS1 | Logical variable, default false. If true, generate output for sos1 handling with XpressM P
Otherwise generate output giving an equivalent formulation with standard integer variables. |
Description of Output
c | Linear objective function cost coefficients, vector m * n × 1. |
x_L | Lower bounds on design parameters x. |
x_U | Upper bounds on design parameters x. |
b_L | Lower bounds on the m + n linear constraints. |
b_U | Upper bounds on the linear constraints. |
a | Sparse m + n × m * n matrix for linear constraints. |
sos1 | If input variable SOS1 is true, structure with sos1 variable information in the form suitable for the Matlab XpressM P interface routine xpress, otherwise empty. |
Description
Converting a general assignment problem (GAP) to standard form suitable for a mixed-integer programming solver. Either binary or sos1 variables are used.
xp2control
Purpose
XpressM P Matlab MEX-interface internal callback routine
Calling Syntax
xp2control(xpicv,xpdcv,xpccv1,xpccv2,xpccv3,xpccv4,xpccv5,xpccv6)
Description of Input
xpicv | Vector of doubles with XpressM P Integer Control Variables. |
xpdcv | Vector of doubles with XpressM P Double Control Variables. |
xpccv1 | String with 1st XpressM P String Control Variable. |
xpccv2 | String with 2nd XpressM P String Control Variable. |
xpccv3 | String with 3rd XpressM P String Control Variable. |
xpccv4 | String with 4th XpressM P String Control Variable. |
xpccv5 | String with 5th XpressM P String Control Variable. |
xpccv6 | String with 6th XpressM P String Control Variable. |
Global Parameters Used
Parameter | Description |
---|---|
xpControlVariables | Structure with all XpressMP control variables. Set before the callback. |
Description
XpressMP Matlab MEX-interface internal callback routine. Creates a global Matlab structure variable xpCon- trolVariables, where the fields corresponds to the XpressM P control variable names as given in Section 7 in the Xpress-Optimizer Reference Manual.
xp2problem
Purpose
XpressMP Matlab MEX-interface internal callback routine
Calling Syntax
xp2problem(xpipv,xpdpv,xpcpv1,xpcpv2,xpcpv3,xpcpv4,xpcpv5)
Description of Input
Input | Description |
---|---|
xpipv | Vector of doubles with XpressM P Integer Problem Variables. |
xpdpv | Vector of doubles with XpressM P Double Problem Variables. |
xpcpv1 | String with 1st XpressM P String Problem Variable. |
xpcpv2 | String with 2nd XpressM P String Problem Variable. |
xpcpv3 | String with 3rd XpressM P String Problem Variable. |
xpcpv4 | String with 4th XpressM P String Problem Variable. |
xpcpv5 | String with 5th XpressM P String Problem Variable. |
Global Parameters Used
Parameter | Description |
---|---|
xpProblemAttrib | Structure with all XpressM P problem attributes listed in Section 8 in the Xpress-Optimizer Reference Manual. Set before the callback. |
Description
XpressM P Matlab MEX-interface internal callback routine. Creates a global Matlab structure variable xpProb- lemAttrib, where the fields corresponds to the XpressM P problem attribute names.