How to write MPS files after presolve using Matlab API?

59 views
Skip to first unread message

bluesbo...@gmail.com

unread,
Jun 22, 2016, 9:09:19 AM6/22/16
to AMPL Modeling Language

Hello,

 

I am trying to solve a large scale problem, which I need to analyse. I am calling AMPL via the Matlab API. How can I write MPS files or others to debug the result of the presolver using the Matlab API?

 

Thank you in advance.

Best regards,

Hakan

Robert Fourer

unread,
Jun 23, 2016, 12:56:22 PM6/23/16
to am...@googlegroups.com
To write an MPS file directly from AMPL, use MATLAB API commands like

ampl.setOption('auxfiles','rc');
ampl.eval('write mtest;');

This writes files named test.mps, test.row, and test.col containing the problem in standard MPS format and lists of the row (constraint) and column (variable) names. You can replace 'test' in the above command with any other filename that you like.

(Users of CPLEX or Gurobi can also take advantage of their features for writing files in extended MPS and 'LP' formats.)

Bob Fourer
am...@googlegroups.com

=======

bluesbo...@gmail.com

unread,
Jun 27, 2016, 11:17:53 AM6/27/16
to AMPL Modeling Language, 4...@ampl.com
Hello Bob,

Thank you for your response. It worked perfectly.

BR,
Hakan
Reply all
Reply to author
Forward
0 new messages