src/work/athos/lp/lp_test.cc
changeset 1272 17be4c5bc6c6
parent 1264 92ba3e62825d
child 1273 2b2ffa625775
     1.1 --- a/src/work/athos/lp/lp_test.cc	Tue Mar 29 13:30:29 2005 +0000
     1.2 +++ b/src/work/athos/lp/lp_test.cc	Wed Mar 30 08:28:44 2005 +0000
     1.3 @@ -24,13 +24,96 @@
     1.4    lp.addColSet(z);
     1.5  
     1.6  
     1.7 -  LP::Expr e;
     1.8 +  LP::Expr e,f,g;
     1.9 +  LP::Col p1,p2,p3,p4,p5;
    1.10 +  LP::Constr c;
    1.11 +  
    1.12 +  e[p1]=2;
    1.13 +  e.constComp()=12;
    1.14 +  e[p1]+=2;
    1.15 +  e.constComp()+=12;
    1.16 +  e[p1]-=2;
    1.17 +  e.constComp()-=12;
    1.18 +  
    1.19 +  e=2;
    1.20 +  e=2.2;
    1.21 +  e=p1;
    1.22 +  e=f;
    1.23 +
    1.24 +  e+=2;
    1.25 +  e+=2.2;
    1.26 +  e+=p1;
    1.27 +  e+=f;
    1.28 +
    1.29 +  e-=2;
    1.30 +  e-=2.2;
    1.31 +  e-=p1;
    1.32 +  e-=f;
    1.33 +
    1.34 +  e*=2;
    1.35 +  e*=2.2;
    1.36 +  e/=2;
    1.37 +  e/=2.2;
    1.38 +
    1.39 +  e=((p1+p2)+(p1-p2)+(p1+12)+(12+p1)+(p1-12)+(12-p1)+
    1.40 +      (f+12)+(12+f)+(p1+f)+(f+p1)+(f+g)+
    1.41 +      (f-12)+(12-f)+(p1-f)+(f-p1)+(f-g)+
    1.42 +      2.2*f+f*2.2+f/2.2+
    1.43 +      2*f+f*2+f/2+
    1.44 +      2.2*p1+p1*2.2+p1/2.2+
    1.45 +      2*p1+p1*2+p1/2
    1.46 +     );
    1.47 +  
    1.48 +
    1.49 +  c = (e  <= f  );
    1.50 +  c = (e  <= 2.2);
    1.51 +  c = (e  <= 2  );
    1.52 +  c = (e  <= p1 );
    1.53 +  c = (2.2<= f  );
    1.54 +  c = (2  <= f  );
    1.55 +  c = (p1 <= f  );
    1.56 +  c = (p1 <= p2 );
    1.57 +  c = (p1 <= 2.2);
    1.58 +  c = (p1 <= 2  );
    1.59 +  c = (2.2<= p2 );
    1.60 +  c = (2  <= p2 );
    1.61 +
    1.62 +  c = (e  >= f  );
    1.63 +  c = (e  >= 2.2);
    1.64 +  c = (e  >= 2  );
    1.65 +  c = (e  >= p1 );
    1.66 +  c = (2.2>= f  );
    1.67 +  c = (2  >= f  );
    1.68 +  c = (p1 >= f  );
    1.69 +  c = (p1 >= p2 );
    1.70 +  c = (p1 >= 2.2);
    1.71 +  c = (p1 >= 2  );
    1.72 +  c = (2.2>= p2 );
    1.73 +  c = (2  >= p2 );
    1.74 +
    1.75 +  c = (e  == f  );
    1.76 +  c = (e  == 2.2);
    1.77 +  c = (e  == 2  );
    1.78 +  c = (e  == p1 );
    1.79 +  c = (2.2== f  );
    1.80 +  c = (2  == f  );
    1.81 +  c = (p1 == f  );
    1.82 +  //c = (p1 == p2 );
    1.83 +  c = (p1 == 2.2);
    1.84 +  c = (p1 == 2  );
    1.85 +  c = (2.2== p2 );
    1.86 +  c = (2  == p2 );
    1.87 +
    1.88 +  c = (2 <= e <= 3);
    1.89 +  c = (2 <= p1<= 3);
    1.90 +
    1.91 +  c = (2 >= e >= 3);
    1.92 +  c = (2 >= p1>= 3);
    1.93 +
    1.94    e[x[3]]=2;
    1.95    e[x[3]]=4;
    1.96    e[x[3]]=1;
    1.97    e.constComp()=12;
    1.98 -
    1.99 -  LP::Col p1,p2,p3,p4,p5;
   1.100    
   1.101    lp.addRow(LP::INF,e,23);
   1.102    lp.addRow(LP::INF,3.0*(p1+p2)-p3,23);
   1.103 @@ -40,6 +123,8 @@
   1.104  
   1.105    lp.addRow(x[1]+x[3]<=x[5]-3);
   1.106    lp.addRow(-7<=x[1]+x[3]-12<=3);
   1.107 +  //lp.addRow(x[1]<=x[5]);
   1.108 +
   1.109  }
   1.110  
   1.111  
   1.112 @@ -57,8 +142,8 @@
   1.113    typedef typename G::InEdgeIt InEdgeIt;
   1.114    
   1.115    typename G::EdgeMap<LpGlpk::Col> x(g);
   1.116 -  // lp.addColSet(x);
   1.117 -  for(EdgeIt e(g);e!=INVALID;++e) x[e]=lp.addCol();
   1.118 +  lp.addColSet(x);
   1.119 +   //for(EdgeIt e(g);e!=INVALID;++e) x[e]=lp.addCol();
   1.120    
   1.121    for(EdgeIt e(g);e!=INVALID;++e) {
   1.122      lp.setColUpperBound(x[e],cap[e]);