Description
This test checks behavior (i.e. model/status codes) for an integer infeasible model. Note that the relaxation is nicely solvable. Contributor: Steve, Dec 2018
Small Model of Type : MIQCP
Category : GAMS Test library
Main file : miqcp04.gms
$title Test behavior for integer infeasible model (MIQCP04,SEQ=792)
$onText
This test checks behavior (i.e. model/status codes) for an integer
infeasible model. Note that the relaxation is nicely solvable.
Contributor: Steve, Dec 2018
$offText
positive variables x1, x2;
binary variables y1, y2;
free variable z;
equations f1, f2, c1, c2, g, h, zDef;
f1.. x1 + y1 =G= 2;
f2.. x2 + y2 =G= 2;
c1.. sqr(x1-0.25) =L= 2;
c2.. sqr(x2-0.25) =L= 2;
g.. x1 + x2 =L= 3;
h.. y1 + y2 =L= 1.5;
zDef.. sqr(x1) + y1 + sqr(x2) + y2 =E= z;
model m / all /;
* DICOPT needs some option to provide a good message for this model
$ifThenI x%system.miqcp%==xdicopt
$echo convex 1 > dicopt.opt
m.optfile = 1;
$endIf
solve m using miqcp min z;
abort$[m.solvestat <> %solveStat.normalCompletion%] 'Expected solvestat 1: Normal Completion';
* IMHO it is pretty lame for this model to return modelstat 19: Infeasible - No Solution
* but we allow it for the moment
if {(m.modelstat eq %modelStat.infeasibleNoSolution%),
abort.noError "modelstat is OK: ", m.modelstat;
};
abort$[(m.modelstat <> %modelStat.infeasible%) and
(m.modelstat <> %modelStat.locallyInfeasible%) and
(m.modelstat <> %modelStat.integerInfeasible%)]
'Expected modelstat 4 or 5 or 10: Globally or Locally or Integer Infeasible';