qcp09.gms : Simplest test for QCP correctness

Description

```Very simple QCP: quadratic obj and 1 quadratic constraint.
It should be impossible to have the wrong conventions for passing Q
matrices (e.g. symmetry treatment, "implied 1/2", signs) and
get this one correct.

Contributor: Steven Dirkse, January 2012
```

Small Model of Type : QCP

Category : GAMS Test library

Main file : qcp09.gms

``````\$title Simplest test for QCP correctness (QCP09,SEQ=555)

\$onText
It should be impossible to have the wrong conventions for passing Q
matrices (e.g. symmetry treatment, "implied 1/2", signs) and
get this one correct.

Contributor: Steven Dirkse, January 2012
\$offText

\$if not set TESTTOL \$set TESTTOL 1e-6

scalars
mchecks / 0 /
tol  / %TESTTOL% /
xbar / 2 /
ybar / 3 /
zbar / 44.25 /
;
\$ifThen set QCPMCHECKS
\$ if not %QCPMCHECKS% == 0 mchecks = 1;
\$else
\$ if not  %QPMCHECKS% == 0 mchecks = 1;
\$endIf

variables x, y, z;
equations f, g;

f .. z =E= -10.875 * x  -1 * y + 3 * sqr(x-5) + x * y + 4 * sqr(y-6);
g .. 3 * sqr(x) + 2 * x * y + 2 * sqr(y) =L= 42;

model m / f, g /;

solve m using qcp min z;

if {(m.solvestat = %solveStat.capabilityProblems%),
abort\$(m.modelstat <> %modelStat.noSolutionReturned%)           'wrong modelstat for capability error';
display 'Solver capability error: further tests suppressed';
else
abort\$(m.solvestat <> %solveStat.normalCompletion% or (m.modelstat > %modelStat.locallyOptimal% and m.modelstat <> %modelStat.feasibleSolution%)) 'wrong status codes';
if {mchecks,