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 > cplex.opt
$echo optimalitytarget 3 > cplex.op2
$set solver lp=cplex rmip=cplex mip=cplex qcp=cplex rmiqcp=cplex miqcp=cplex 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