gurobi06.gms : GUROBI test suite - general constraints norm

Description

```Tests a model with 0-norm, 1-norm, 2-norm and inf-norm constraints.

Contributor: Renke Kuhlmann, November 2021
```

Small Model of Type : GAMS

Category : GAMS Test library

Main file : gurobi06.gms

``````\$TITLE 'GUROBI test suite - general constraints norm' (GUROBI06,SEQ=882)
\$ontext
Tests a model with 0-norm, 1-norm, 2-norm and inf-norm constraints.

Contributor: Renke Kuhlmann, November 2021
\$offtext

Variables x1, x2, r, obj;
Equations defobj, eqnorm;

defobj.. obj =e= x1 + x2;
eqnorm.. r =e= x1 + x2;
r.up = 1;

Model m / all /;

option solver = gurobi;
\$onecho > gurobi.opt
eqnorm.genconstrtype 14
\$offecho
\$onecho > gurobi.op2
eqnorm.genconstrtype 15
\$offecho
\$onecho > gurobi.op3
eqnorm.genconstrtype 16
\$offecho
\$onecho > gurobi.op4
eqnorm.genconstrtype 17
\$offecho

* without norm constraints
Solve m using LP maximizing obj;
abort\$(m.modelstat<>1) 'incorrect model status';
abort\$(abs(obj.l - 1) > 1e-4) 'incorrect objective';

* with 0-norm constraints
m.optfile=1;
Solve m using LP maximizing obj;
abort\$(m.modelstat<>3 and m.modelstat<>18) 'incorrect model status';

* with 1-norm constraints
m.optfile=2;
Solve m using LP maximizing obj;
abort\$(m.modelstat<>1) 'incorrect model status';
abort\$(abs(obj.l - 1) > 1e-4) 'incorrect objective';

* with 2-norm constraints
m.optfile=3;
Solve m using LP maximizing obj;
abort\$(m.modelstat<>1) 'incorrect model status';
abort\$(abs(obj.l - 1.41421) > 1e-4) 'incorrect objective';

* with inf-norm constraints
m.optfile=4;
Solve m using LP maximizing obj;
abort\$(m.modelstat<>1) 'incorrect model status';
abort\$(abs(obj.l - 2) > 1e-4) 'incorrect objective';
``````
GAMS Development Corp.
GAMS Software GmbH

General Information and Sales
U.S. (+1) 202 342-0180
Europe: (+49) 221 949-9170
GAMS is a registered trademark of GAMS Software GmbH in the European Union