trylin01.gms : Test model attribute TryLinear

Description

```Run trnsport with transport.trylinear = 1 using different combinations of model
types, solvers, and solvelink choices and make sure the final model type and
solver used is correct

Contributor: Jan-H. Jagla, April 2010
```

Small Model of Type : GAMS

Category : GAMS Test library

Main file : trylin01.gms

``````\$title Test model attribute TryLinear (TRYLIN01,SEQ=482)

\$ontext
Run trnsport with transport.trylinear = 1 using different combinations of model
types, solvers, and solvelink choices and make sure the final model type and
solver used is correct

Contributor: Jan-H. Jagla, April 2010
\$offtext

\$onecho > trnstl.gms
Sets
i   canning plants   / seattle, san-diego /
j   markets          / new-york, chicago, topeka / ;
Parameters
a(i)  capacity of plant i in cases
/    seattle     350
san-diego   600  /
b(j)  demand at market j in cases
/    new-york    325
chicago     300
topeka      275  / ;
Table d(i,j)  distance in thousands of miles
new-york       chicago      topeka
seattle          2.5           1.7          1.8
san-diego        2.5           1.8          1.4  ;
Scalar f  freight in dollars per case per thousand miles  /90/ ;
Parameter c(i,j)  transport cost in thousands of dollars per case ;
c(i,j) = f * d(i,j) / 1000 ;
Variables
x(i,j)  shipment quantities in cases
z       total transportation costs in thousands of dollars ;
Positive Variable x ;
Equations
cost        define objective function
supply(i)   observe supply limit at plant i
demand(j)   satisfy demand at market j ;
cost ..        z  =e=  sum((i,j), c(i,j)*x(i,j)) ;
supply(i) ..   sum(j, x(i,j))  =l=  a(i) ;
demand(j) ..   sum(i, x(i,j))  =g=  b(j) ;
Model transport /all/ ;
transport.trylinear = 1;
Solve transport using %MTYPE% minimizing z ;
\$offecho

\$onechoV > tlscript.gms
\$call gams trnstl lo=2 --MTYPE=%2 %3=%4 solvelink=%5
\$echo %3  > shouldbe.txt
\$echo %4 >> shouldbe.txt
\$call grep "^     TYPE    " trnstl.lst | tr -s " " | cut -d" " -f3  > is.txt
\$call grep "^     SOLVER  " trnstl.lst | tr -s " " | cut -d" " -f3 >> is.txt
\$call diff -bw shouldbe.txt is.txt
\$if errorlevel 1 \$abort --MTYPE=%2 %3=%4 solvelink=%5 failed
\$offecho

\$batinclude tlscript.gms 1 QCP    LP   SOPLEX  %Solvelink.ChainScript%
\$batinclude tlscript.gms 1 NLP    LP   SOPLEX  %Solvelink.ChainScript%
\$batinclude tlscript.gms 1 DNLP   LP   SOPLEX  %Solvelink.ChainScript%
\$batinclude tlscript.gms 1 RMIQCP RMIP SOPLEX  %Solvelink.ChainScript%
\$batinclude tlscript.gms 1 RMINLP RMIP SOPLEX  %Solvelink.ChainScript%
\$batinclude tlscript.gms 1 MIQCP  MIP  SCIP    %Solvelink.ChainScript%
\$batinclude tlscript.gms 1 MINLP  MIP  SCIP    %Solvelink.ChainScript%

\$batinclude tlscript.gms 1 QCP    LP   SOPLEX  %Solvelink.CallScript%
\$batinclude tlscript.gms 1 NLP    LP   SOPLEX  %Solvelink.CallScript%
\$batinclude tlscript.gms 1 DNLP   LP   SOPLEX  %Solvelink.CallScript%
\$batinclude tlscript.gms 1 RMIQCP RMIP SOPLEX  %Solvelink.CallScript%
\$batinclude tlscript.gms 1 RMINLP RMIP SOPLEX  %Solvelink.CallScript%
\$batinclude tlscript.gms 1 MIQCP  MIP  SCIP    %Solvelink.CallScript%
\$batinclude tlscript.gms 1 MINLP  MIP  SCIP    %Solvelink.CallScript%

\$batinclude tlscript.gms 1 QCP    LP   SOPLEX  %Solvelink.CallModule%
\$batinclude tlscript.gms 1 NLP    LP   SOPLEX  %Solvelink.CallModule%
\$batinclude tlscript.gms 1 DNLP   LP   SOPLEX  %Solvelink.CallModule%
\$batinclude tlscript.gms 1 RMIQCP RMIP SOPLEX  %Solvelink.CallModule%
\$batinclude tlscript.gms 1 RMINLP RMIP SOPLEX  %Solvelink.CallModule%
\$batinclude tlscript.gms 1 MIQCP  MIP  SCIP    %Solvelink.CallModule%
\$batinclude tlscript.gms 1 MINLP  MIP  SCIP    %Solvelink.CallModule%

* Now try solvers that support in-core communication (solvelink=5)
\$batinclude tlscript.gms 2 QCP    LP   CONOPT %Solvelink.ChainScript%
\$batinclude tlscript.gms 2 NLP    LP   CONOPT %Solvelink.ChainScript%
\$batinclude tlscript.gms 2 DNLP   LP   CONOPT %Solvelink.ChainScript%
\$batinclude tlscript.gms 2 RMIQCP RMIP CONOPT %Solvelink.ChainScript%
\$batinclude tlscript.gms 2 RMINLP RMIP CONOPT %Solvelink.ChainScript%
\$batinclude tlscript.gms 2 MIQCP  MIP  CPLEX  %Solvelink.ChainScript%
\$batinclude tlscript.gms 2 MINLP  MIP  CPLEX  %Solvelink.ChainScript%

\$batinclude tlscript.gms 2 QCP    LP   CONOPT %Solvelink.CallScript%
\$batinclude tlscript.gms 2 NLP    LP   CONOPT %Solvelink.CallScript%
\$batinclude tlscript.gms 2 DNLP   LP   CONOPT %Solvelink.CallScript%
\$batinclude tlscript.gms 2 RMIQCP RMIP CONOPT %Solvelink.CallScript%
\$batinclude tlscript.gms 2 RMINLP RMIP CONOPT %Solvelink.CallScript%
\$batinclude tlscript.gms 2 MIQCP  MIP  CPLEX  %Solvelink.CallScript%
\$batinclude tlscript.gms 2 MINLP  MIP  CPLEX  %Solvelink.CallScript%

\$batinclude tlscript.gms 2 QCP    LP   CONOPT %Solvelink.CallModule%
\$batinclude tlscript.gms 2 NLP    LP   CONOPT %Solvelink.CallModule%
\$batinclude tlscript.gms 2 DNLP   LP   CONOPT %Solvelink.CallModule%
\$batinclude tlscript.gms 2 RMIQCP RMIP CONOPT %Solvelink.CallModule%
\$batinclude tlscript.gms 2 RMINLP RMIP CONOPT %Solvelink.CallModule%
\$batinclude tlscript.gms 2 MIQCP  MIP  CPLEX  %Solvelink.CallModule%
\$batinclude tlscript.gms 2 MINLP  MIP  CPLEX  %Solvelink.CallModule%