Exporting matrices
If the optimization process with Xpress Optimizer is started from within a BCL program (methods lpOptimize or mipOptimize of XPRBprob), then the problem matrix is loaded in memory into the solver without writing it out to a file (which would be expensive in terms of running time). However, in certain cases it may still be required to be able to produce a matrix. With Xpress, the user has the choice between two matrix formats: extended MPS and extended LP format, the latter being in general more easily human-readable since constraints are printed in algebraic form.
To export a matrix in MPS format add the following line to your BCL program, immediately before or instead of the optimization statement; this will create the file Folio.mat in your working directory:
p.exportProb(XPRB_MPS, "Folio");
For an LP format matrix use the following:
p.setSense(XPRB_MAXIM); p.exportProb(XPRB_LP, "Folio");
The LP format contains information about the sense of optimization. Since the default is to minimize, for maximization we first need to reset the sense. The resulting matrix file will have the name Folio.lp.