Description
This model demonstrates a problem we have in gams21.5 thru 21.7 (updating of a one-dimensional set used in optimization)
Small Model of Type : GAMS
Category : GAMS Test library
Main file : loop9.gms
$title 'Test use of set with a single element in a loop' (LOOP9,SEQ=225)
$onText
This model demonstrates a problem we have in gams21.5 thru 21.7
(updating of a one-dimensional set used in optimization)
$offText
Set s(*) Model Sequence Numbers /1*311/;
Set t(*) single model types /
DECIS ,
GAMS ,
LP ,
MIP ,
NLP ,
MCP ,
MPSGE ,
MINLP ,
RMIP ,
RMINLP ,
CNS ,
DNLP ,
EMPSE ,
MPEC ,
QCP ,
MIQCP ,
RMIQCP /;
Set xsolvercapabilities(*,*) /
DEA.LP ,
DEA.MIP ,
DEA.RMIP ,
EMPSE.LP ,
EMPSE.RMIP ,
baron.LP ,
baron.MIP ,
baron.NLP ,
baron.MINLP ,
baron.RMIP ,
baron.RMINLP ,
baron.DNLP ,
baron.QCP ,
baron.MIQCP ,
baron.RMIQCP ,
conopt.LP ,
conopt.NLP ,
conopt.RMIP ,
conopt.RMINLP ,
conopt.CNS ,
conopt.DNLP ,
conopt.QCP ,
conopt.RMIQCP ,
cplex.LP ,
cplex.MIP ,
cplex.RMIP ,
cplex.QCP ,
cplex.MIQCP ,
cplex.RMIQCP ,
dicopt.MINLP ,
knitro.LP ,
knitro.NLP ,
knitro.RMIP ,
knitro.RMINLP ,
knitro.DNLP ,
knitro.QCP ,
knitro.RMIQCP ,
miles.MCP ,
minos.LP ,
minos.NLP ,
minos.RMIP ,
minos.RMINLP ,
minos.DNLP ,
minos.QCP ,
minos.RMIQCP ,
mosek.LP ,
mosek.MIP ,
mosek.NLP ,
mosek.RMIP ,
mosek.RMINLP ,
mosek.DNLP ,
mosek.QCP ,
mosek.MIQCP ,
mosek.RMIQCP ,
nlpec.MCP ,
nlpec.MPEC ,
emp.LP ,
emp.MIP ,
emp.RMIP ,
path.MCP ,
path.CNS ,
pathnlp.LP ,
pathnlp.NLP ,
pathnlp.RMIP ,
pathnlp.RMINLP ,
pathnlp.DNLP ,
pathnlp.QCP ,
pathnlp.RMIQCP ,
sbb.MINLP ,
sbb.MIQCP ,
snopt.LP ,
snopt.NLP ,
snopt.RMIP ,
snopt.RMINLP ,
snopt.DNLP ,
snopt.QCP ,
snopt.RMIQCP ,
xpress.LP ,
xpress.MIP ,
xpress.RMIP ,
xpress.QCP ,
xpress.RMIQCP /;
Parameter test(*,*) model type summary /
1.LP 1 ,
1.total 1 ,
2.LP 1 ,
2.total 1 ,
3.LP 1 ,
3.total 1 ,
4.LP 1 ,
4.total 1 ,
5.LP 1 ,
5.total 1 ,
6.LP 1 ,
6.total 1 ,
7.LP 1 ,
7.total 1 ,
8.LP 1 ,
8.total 1 ,
9.MIP 1 ,
9.total 1 ,
10.LP 1 ,
10.total 1 ,
11.LP 1 ,
11.total 1 ,
12.MIP 1 ,
12.total 1 ,
13.LP 1 ,
13.total 1 ,
14.MIP 1 ,
14.total 1 ,
15.LP 1 ,
15.total 1 ,
16.MIP 1 ,
16.total 1 ,
17.LP 1 ,
17.total 1 ,
18.NLP 1 ,
18.total 1 ,
19.MIP 1 ,
19.total 1 ,
20.NLP 1 ,
20.total 1 ,
21.NLP 1 ,
21.total 1 ,
22.NLP 1 ,
22.total 1 ,
23.LP 1 ,
23.NLP 1 ,
23.DNLP 1 ,
23.total 3 ,
24.NLP 1 ,
24.total 1 ,
25.NLP 1 ,
25.total 1 ,
26.LP 1 ,
26.NLP 1 ,
26.total 2 ,
27.NLP 1 ,
27.total 1 ,
28.NLP 1 ,
28.total 1 ,
29.total 1 ,
30.MIP 1 ,
30.RMIP 1 ,
30.total 2 ,
31.MIP 1 ,
31.total 1 ,
32.LP 1 ,
32.total 1 ,
33.NLP 1 ,
33.total 1 ,
34.LP 1 ,
34.total 1 ,
35.LP 1 ,
35.total 1 ,
36.NLP 1 ,
36.total 1 ,
37.LP 1 ,
37.total 1 ,
38.MIP 1 ,
38.total 1 ,
39.LP 1 ,
39.total 1 ,
40.LP 1 ,
40.total 1 ,
41.NLP 1 ,
41.total 1 ,
42.MIP 1 ,
42.total 1 ,
43.NLP 1 ,
43.total 1 ,
44.LP 1 ,
44.MIP 1 ,
44.total 2 ,
45.MIP 1 ,
45.total 1 ,
46.LP 1 ,
46.total 1 ,
47.NLP 1 ,
47.total 1 ,
48.MIP 1 ,
48.total 1 ,
49.LP 1 ,
49.total 1 ,
50.LP 1 ,
50.total 1 ,
51.MIP 1 ,
51.total 1 ,
52.LP 1 ,
52.NLP 1 ,
52.total 2 ,
53.NLP 1 ,
53.total 1 ,
54.LP 1 ,
54.total 1 ,
55.LP 1 ,
55.total 1 ,
56.LP 1 ,
56.total 1 ,
57.LP 1 ,
57.total 1 ,
58.MIP 1 ,
58.CNS 1 ,
58.total 2 ,
59.LP 1 ,
59.total 1 ,
60.LP 1 ,
60.total 1 ,
61.LP 1 ,
61.total 1 ,
62.LP 1 ,
62.total 1 ,
63.NLP 1 ,
63.total 1 ,
64.NLP 1 ,
64.total 1 ,
65.LP 1 ,
65.total 1 ,
66.LP 1 ,
66.total 1 ,
67.total 1 ,
68.DNLP 1 ,
68.total 1 ,
69.NLP 1 ,
69.total 1 ,
70.total 1 ,
71.total 1 ,
72.total 1 ,
73.total 1 ,
74.LP 1 ,
74.total 1 ,
75.LP 1 ,
75.total 1 ,
76.NLP 1 ,
76.total 1 ,
77.NLP 1 ,
77.total 1 ,
78.LP 1 ,
78.total 1 ,
79.LP 1 ,
79.total 1 ,
80.NLP 1 ,
80.total 1 ,
81.NLP 1 ,
81.total 1 ,
82.LP 1 ,
82.total 1 ,
83.NLP 1 ,
83.total 1 ,
84.NLP 1 ,
84.total 1 ,
85.NLP 1 ,
85.total 1 ,
86.NLP 1 ,
86.total 1 ,
87.LP 1 ,
87.total 1 ,
88.LP 1 ,
88.total 1 ,
89.LP 1 ,
89.total 1 ,
90.LP 1 ,
90.total 1 ,
91.LP 1 ,
91.total 1 ,
92.LP 1 ,
92.NLP 1 ,
92.total 2 ,
93.total 1 ,
94.total 1 ,
95.NLP 1 ,
95.total 1 ,
96.NLP 1 ,
96.total 1 ,
97.NLP 1 ,
97.total 1 ,
98.MIP 1 ,
98.total 1 ,
99.NLP 1 ,
99.total 1 ,
100.NLP 1 ,
100.total 1 ,
101.total 1 ,
102.LP 1 ,
102.total 1 ,
103.MIP 1 ,
103.total 2 ,
104.total 1 ,
105.MIP 1 ,
105.total 1 ,
106.LP 1 ,
106.total 1 ,
107.NLP 1 ,
107.total 1 ,
108.LP 1 ,
108.total 1 ,
109.MIP 1 ,
109.total 1 ,
110.LP 1 ,
110.NLP 1 ,
110.total 2 ,
111.NLP 1 ,
111.total 1 ,
112.NLP 1 ,
112.total 1 ,
113.MIP 1 ,
113.NLP 1 ,
113.MINLP 1 ,
113.total 1 ,
114.MIP 1 ,
114.total 1 ,
115.MIP 1 ,
115.total 1 ,
116.MIP 1 ,
116.NLP 1 ,
116.MINLP 1 ,
116.total 1 ,
117.MIP 1 ,
117.NLP 1 ,
117.MINLP 1 ,
117.total 1 ,
118.MIP 1 ,
118.NLP 1 ,
118.total 2 ,
119.MIP 1 ,
119.NLP 1 ,
119.MINLP 1 ,
119.total 1 ,
120.MIP 1 ,
120.NLP 1 ,
120.total 2 ,
121.MIP 1 ,
121.total 1 ,
122.MIP 1 ,
122.NLP 1 ,
122.MINLP 1 ,
122.total 1 ,
123.MIP 1 ,
123.NLP 1 ,
123.MINLP 1 ,
123.total 1 ,
124.MIP 1 ,
124.NLP 1 ,
124.MINLP 1 ,
124.RMINLP 1 ,
124.total 3 ,
125.MIP 1 ,
125.NLP 1 ,
125.MINLP 1 ,
125.total 1 ,
126.MCP 1 ,
126.total 1 ,
127.MCP 1 ,
127.total 1 ,
128.MCP 1 ,
128.total 1 ,
129.MCP 1 ,
129.total 1 ,
130.MCP 1 ,
130.total 1 ,
131.MCP 1 ,
131.total 1 ,
132.MCP 1 ,
132.total 1 ,
133.MCP 1 ,
133.total 1 ,
134.MCP 1 ,
134.total 1 ,
135.MCP 1 ,
135.total 1 ,
136.MCP 1 ,
136.total 1 ,
137.MCP 1 ,
137.total 1 ,
138.MCP 1 ,
138.total 1 ,
139.MCP 1 ,
139.total 2 ,
140.MCP 1 ,
140.total 2 ,
141.MCP 1 ,
141.total 2 ,
142.MCP 1 ,
142.total 2 ,
143.MCP 1 ,
143.total 2 ,
144.MCP 1 ,
144.total 2 ,
145.MCP 1 ,
145.total 2 ,
146.MCP 1 ,
146.total 2 ,
147.MCP 1 ,
147.total 2 ,
148.MCP 1 ,
148.total 2 ,
149.MCP 1 ,
149.total 2 ,
150.MCP 1 ,
150.total 2 ,
151.MCP 1 ,
151.total 2 ,
152.MCP 1 ,
152.total 2 ,
153.MCP 1 ,
153.total 2 ,
154.MCP 1 ,
154.total 2 ,
155.MCP 1 ,
155.total 2 ,
156.MCP 1 ,
156.total 2 ,
157.total 1 ,
158.MIP 1 ,
158.total 1 ,
159.MIP 1 ,
159.total 1 ,
160.MIP 1 ,
160.total 1 ,
161.NLP 1 ,
161.total 1 ,
162.total 1 ,
163.MIP 1 ,
163.total 1 ,
164.LP 1 ,
164.total 1 ,
165.NLP 1 ,
165.total 1 ,
166.NLP 1 ,
166.total 1 ,
167.NLP 1 ,
167.total 1 ,
168.MIP 1 ,
168.NLP 1 ,
168.MINLP 1 ,
168.total 1 ,
169.NLP 1 ,
169.MCP 1 ,
169.total 2 ,
170.MIP 1 ,
170.total 1 ,
171.NLP 1 ,
171.total 1 ,
172.NLP 1 ,
172.total 1 ,
173.NLP 1 ,
173.total 1 ,
174.NLP 1 ,
174.total 1 ,
175.LP 1 ,
175.total 1 ,
176.MIP 1 ,
176.total 1 ,
177.MIP 1 ,
177.total 1 ,
178.MIP 1 ,
178.total 1 ,
179.MIP 1 ,
179.total 1 ,
180.MIP 1 ,
180.total 1 ,
181.LP 1 ,
181.total 1 ,
182.MIP 1 ,
182.RMIP 1 ,
182.total 2 ,
183.total 1 ,
184.MCP 1 ,
184.total 1 ,
185.MIP 1 ,
185.total 1 ,
186.LP 1 ,
186.EMPSE 1 ,
186.total 2 ,
187.LP 1 ,
187.EMPSE 1 ,
187.total 2 ,
188.LP 1 ,
188.EMPSE 1 ,
188.total 2 ,
189.LP 1 ,
189.EMPSE 1 ,
189.total 2 ,
190.total 1 ,
191.MIP 1 ,
191.total 1 ,
192.LP 1 ,
192.total 1 ,
193.MIP 1 ,
193.total 1 ,
194.MIP 1 ,
194.NLP 1 ,
194.total 2 ,
195.total 1 ,
196.DECIS 1 ,
196.LP 1 ,
196.total 2 ,
197.DECIS 1 ,
197.total 1 ,
198.DECIS 1 ,
198.total 1 ,
199.DECIS 1 ,
199.LP 1 ,
199.total 2 ,
200.DECIS 1 ,
200.LP 1 ,
200.total 2 ,
201.NLP 1 ,
201.total 1 ,
202.NLP 1 ,
202.total 1 ,
203.MIP 1 ,
203.NLP 1 ,
203.MINLP 1 ,
203.total 1 ,
204.MIP 1 ,
204.NLP 1 ,
204.MINLP 1 ,
204.total 1 ,
205.MIP 1 ,
205.NLP 1 ,
205.MINLP 1 ,
205.total 1 ,
206.MIP 1 ,
206.NLP 1 ,
206.MINLP 1 ,
206.total 1 ,
207.LP 1 ,
207.MIP 1 ,
207.total 2 ,
208.MIP 1 ,
208.total 1 ,
209.CNS 1 ,
209.total 1 ,
210.CNS 1 ,
210.total 1 ,
211.CNS 1 ,
211.total 1 ,
212.CNS 1 ,
212.total 1 ,
213.MIP 1 ,
213.total 1 ,
214.NLP 1 ,
214.total 1 ,
215.total 1 ,
216.total 1 ,
217.MIP 1 ,
217.NLP 1 ,
217.MINLP 1 ,
217.DNLP 1 ,
217.total 3 ,
218.MIP 1 ,
218.total 1 ,
219.MIP 1 ,
219.total 1 ,
220.MIP 1 ,
220.total 1 ,
221.MIP 1 ,
221.total 1 ,
222.MIP 1 ,
222.NLP 1 ,
222.MINLP 1 ,
222.total 1 ,
223.MIP 1 ,
223.NLP 1 ,
223.MINLP 1 ,
223.total 1 ,
224.MIP 1 ,
224.NLP 1 ,
224.MINLP 1 ,
224.total 1 ,
225.MIP 1 ,
225.NLP 1 ,
225.MINLP 1 ,
225.total 1 ,
226.MIP 1 ,
226.NLP 1 ,
226.MINLP 1 ,
226.total 1 ,
227.MIP 1 ,
227.NLP 1 ,
227.MINLP 1 ,
227.total 1 ,
228.NLP 1 ,
228.MCP 1 ,
228.total 2 ,
229.NLP 1 ,
229.total 1 ,
230.NLP 1 ,
230.total 1 ,
231.NLP 1 ,
231.total 1 ,
232.NLP 1 ,
232.total 1 ,
233.NLP 1 ,
233.total 1 ,
234.NLP 1 ,
234.total 1 ,
235.NLP 1 ,
235.total 1 ,
236.NLP 1 ,
236.total 1 ,
237.NLP 1 ,
237.total 1 ,
238.NLP 1 ,
238.total 1 ,
239.NLP 1 ,
239.total 1 ,
240.NLP 1 ,
240.total 1 ,
241.NLP 1 ,
241.total 1 ,
242.NLP 1 ,
242.total 1 ,
243.NLP 1 ,
243.total 1 ,
244.NLP 1 ,
244.total 1 ,
245.NLP 1 ,
245.total 1 ,
246.NLP 1 ,
246.total 1 ,
247.MIP 1 ,
247.total 1 ,
248.LP 1 ,
248.total 1 ,
249.LP 1 ,
249.total 1 ,
250.MIP 1 ,
250.NLP 1 ,
250.MINLP 1 ,
250.total 1 ,
251.NLP 1 ,
251.total 1 ,
252.NLP 1 ,
252.total 1 ,
253.NLP 1 ,
253.total 1 ,
254.NLP 1 ,
254.total 1 ,
255.NLP 1 ,
255.total 1 ,
256.NLP 1 ,
256.total 1 ,
257.NLP 1 ,
257.total 1 ,
258.NLP 1 ,
258.total 1 ,
259.DNLP 1 ,
259.total 1 ,
260.DNLP 1 ,
260.total 1 ,
261.NLP 1 ,
261.total 1 ,
262.total 1 ,
263.DNLP 1 ,
263.total 1 ,
264.NLP 1 ,
264.total 1 ,
265.DNLP 1 ,
265.total 1 ,
266.NLP 1 ,
266.total 1 ,
267.NLP 1 ,
267.total 1 ,
268.MIP 1 ,
268.total 1 ,
269.MCP 1 ,
269.MPEC 1 ,
269.total 2 ,
270.MIP 1 ,
270.NLP 1 ,
270.MINLP 1 ,
270.total 1 ,
271.LP 1 ,
271.total 1 ,
272.MIP 1 ,
272.total 1 ,
273.LP 1 ,
273.total 1 ,
274.NLP 1 ,
274.total 1 ,
275.NLP 1 ,
275.total 1 ,
276.NLP 1 ,
276.total 1 ,
277.NLP 1 ,
277.total 1 ,
278.NLP 1 ,
278.total 1 ,
279.NLP 1 ,
279.total 1 ,
280.NLP 1 ,
280.total 1 ,
281.NLP 1 ,
281.total 1 ,
282.MIP 1 ,
282.QCP 1 ,
282.MIQCP 1 ,
282.total 2 ,
283.QCP 1 ,
283.total 1 ,
284.QCP 1 ,
284.total 1 ,
285.QCP 1 ,
285.total 1 ,
286.MIP 1 ,
286.NLP 1 ,
286.MINLP 1 ,
286.total 1 ,
287.MIP 1 ,
287.total 1 ,
288.MIP 1 ,
288.total 1 ,
289.MIP 1 ,
289.total 1 ,
290.MIP 1 ,
290.total 1 ,
291.MIP 1 ,
291.QCP 1 ,
291.MIQCP 1 ,
291.total 1 ,
292.total 1 ,
293.QCP 1 ,
293.total 1 ,
294.MIP 1 ,
294.total 1 ,
295.NLP 1 ,
295.total 1 ,
296.MIP 1 ,
296.QCP 1 ,
296.MIQCP 1 ,
296.total 1 ,
297.total 1 ,
298.MIP 1 ,
298.total 1 ,
299.DNLP 1 ,
299.total 1 ,
300.DNLP 1 ,
300.total 1 ,
301.NLP 1 ,
301.total 1 ,
302.NLP 1 ,
302.total 1 ,
303.NLP 1 ,
303.total 1 ,
304.MCP 1 ,
304.total 1 ,
305.DNLP 1 ,
305.total 1 ,
306.MIP 1 ,
306.total 1 ,
307.total 1 ,
308.total 1 ,
309.MIP 1 ,
309.total 1 ,
310.MIP 1 ,
310.total 1 ,
311.total 1 ,
total.DECIS 5 ,
total.GAMS 24 ,
total.LP 67 ,
total.MIP 57 ,
total.NLP 98 ,
total.MCP 35 ,
total.MPSGE 19 ,
total.MINLP 23 ,
total.RMIP 2 ,
total.RMINLP 1 ,
total.CNS 5 ,
total.DNLP 10 ,
total.EMPSE 4 ,
total.MPEC 1 ,
total.QCP 5 ,
total.MIQCP 3 /;
Set solver(*) master set of solvers /
baron ,
conopt ,
cplex ,
dicopt ,
knitro ,
miles ,
minos ,
mosek ,
nlpec ,
emp ,
path ,
pathnlp ,
sbb ,
snopt ,
xpress /;
set ttt(t), sss(solver);
scalar xxx /130/, spd, spd2, ords;
loop {s$((ord(s) >= 121) and (ord(s) <= 150)),
ttt(t) = test(s,t);
sss(solver) = NO;
sss(solver) = sum(ttt, xsolvercapabilities(solver,ttt));
* sss(solver)$xSolvers(solver) = sum(ttt, xsolvercapabilities(solver,ttt));
spd = 0;
spd2=0;
if {(card(ttt)=1),
OrdS = Ord(s);
if { (OrdS >= xxx),
spd=sum{xsolvercapabilities(sss,ttt), 1};
};
spd2 = 0;
loop{xsolvercapabilities(sss,ttt),
spd2 = spd2 + 1;
};
if { (OrdS >= xxx) and (spd <> spd2),
display "failed with", OrdS, spd, spd2
abort "failed check";
};
};
};