% Testing rlqe (xopt-qe)
% Multi-Index Transportation Problem

rlset reals;


{}


mtp2 := ex(x11,ex(x12,ex(x13,ex(x21,ex(x22,ex(x23,ex(x31,ex(x32,ex(x33,
x11+x12+x13=a1 and x21+x22+x23=a2 and x31+x32+x33=a3 and
x11+x21+x31=b1 and x12+x22+x32=b2 and x13+x23+x33=b3 and
0 leq x11 and 0 leq x12 and 0 leq x13 and
0 leq x21 and 0 leq x22 and 0 leq x23 and
0 leq x31 and 0 leq x32 and 0 leq x33
)))))))))$



rlqe mtp2;


(b3 >= 0 and b2 >= 0 and a3 - b2 - b3 >= 0 and a2 >= 0 and a1 >= 0

 and a1 + a2 + a3 - b1 - b2 - b3 = 0) or (b3 >= 0 and a3 - b3 >= 0

 and a3 - b2 - b3 <= 0 and a2 + a3 - b2 - b3 >= 0 and a1 >= 0

 and a1 + a2 + a3 - b1 - b2 - b3 = 0) or (b3 >= 0 and a3 - b3 >= 0 and a2 >= 0

 and a2 + a3 - b2 - b3 <= 0 and a1 + a2 + a3 - b2 - b3 >= 0

 and a1 + a2 + a3 - b1 - b2 - b3 = 0) or (b2 >= 0 and a3 >= 0 and a3 - b3 <= 0

 and a2 - b2 >= 0 and a1 + a3 - b3 >= 0 and a1 + a2 + a3 - b1 - b2 - b3 = 0) or 

(b2 >= 0 and a3 >= 0 and a1 >= 0 and a1 + a3 - b3 <= 0

 and a1 + a2 + a3 - b2 - b3 >= 0 and a1 + a2 + a3 - b1 - b2 - b3 = 0) or (

a3 >= 0 and a3 - b3 <= 0 and a2 >= 0 and a2 - b2 <= 0

 and a1 + a2 + a3 - b2 - b3 >= 0 and a1 + a2 + a3 - b1 - b2 - b3 = 0)


end;

Tested on alfred running Linux 4.4.38.1.amd64-smp x86_64 CSL
Time (counter 1): 30 ms  plus GC time: 40 ms
1: real 0.33
user 0.21
sys 0.04
