mps2gms1.gms : Test mps2gms

Description

This model tests the mps2gms tool, by letting Cplex write out MPS files
which we translate back into generic GAMS models, solve them and check that
the objective is somewhat close. We do that for LP, MIP, QP, and QCP models.

Contributor: Michael Bussieck, December 2014


Small Model of Type : GAMS


Category : GAMS Test library


Main file : mps2gms1.gms

$Title Test mps2gms (MPS2GMS1,SEQ=672)

$Ontext
This model tests the mps2gms tool, by letting Cplex write out MPS files
which we translate back into generic GAMS models, solve them and check that
the objective is somewhat close. We do that for LP, MIP, QP, and QCP models.

Contributor: Michael Bussieck, December 2014
$Offtext


$echo writemps test.mps > cplexd.opt
$echo solutiontarget  3 > cplexd.op2
$set solver lp=cplexd rmip=cplexd mip=cplexd qcp=cplexd rmiqcp=cplexd miqcp=cplexd optcr=0

$set rs "%gams.scrdir%rs.%gams.scrext%"
$onechoV > "%rs%"
$setargs model obj
$call gamslib -q %model%
$if errorlevel 1 $abort could not retrive %model%
$call rm -f test.mps
$call gams %model% lo=2 optfile=1 %solver%
$if errorlevel 1 $abort could not run %model% to produce MPS file
$if not exist test.mps $abort test.mps not created by %model% run
$call mps2gms test.mps test.gdx test.gms > %system.nullfile%
$if errorlevel 1 $abort problems running mps2gms on %model%
$if not exist test.gms $abort problems finding test.gms for %model%
$echo "abort$(abs(abs(obj.l)-%obj%)>1e-2) 'wrong obj %obj%<>', obj.l;" >> test.gms
$call gams test lo=2 optfile=2 %solver%
$if errorlevel 1 $abort could not run test (%model%) or wrong objective. Inspect test.lst.
$offecho

$batinclude "%rs%" trnsport     153.675
$batinclude "%rs%" cube           4
$batinclude "%rs%" qdemo7   1589042.385503
$batinclude "%rs%" pmeanvar     108.65189