miqcp04.gms : Test behavior for integer infeasible model

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.Infeasible-NoSolution%),
  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';