Xpress Appendix B
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 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, I ntV ars] = 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 Xpress MP
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 XpressMP Integer Control Variables. |
xpdcv | Vector of doubles with XpressMP 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 Xpress MP String Control Variable. |
Global Parameters Used
Parameter | Description |
---|---|
xpControlVariables | Structure with all XpressMP control variables. Set before the callback. |
escription
Xpress MP 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 [1].
xp2problem
Purpose
Xpress MP 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 Xpress MP String Problem Variable. |
xpcpv2 | String with 2nd Xpress MP String Problem Variable. |
xpcpv3 | String with 3rd Xpress MP String Problem Variable. |
xpcpv4 | String with 4th XpressMP String Problem Variable. |
xpcpv5 | String with 5th Xpress MP String Problem Variable. |
Global Parameters Used
Parameter | Description |
---|---|
xpProblemAttrib | Structure with all Xpress MP problem attributes listed in Section 8 in the Xpress-Optimizer Reference Manual [1]. Set before the callback. |
Description
Xpress MP 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.