Changeset 2264:90c66dc93ca4 in lemon0.x
 Timestamp:
 10/27/06 14:39:13 (14 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@3022
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

test/lp_test.cc
r1956 r2264 20 20 #include <lemon/lp_skeleton.h> 21 21 #include "test_tools.h" 22 22 #include <lemon/tolerance.h> 23 23 24 24 #ifdef HAVE_CONFIG_H … … 176 176 lp.addRow(7<=x[1]+x[3]12<=3); 177 177 lp.addRow(x[1]<=x[5]); 178 179 std::ostringstream buf; 180 181 182 //Checking the simplify function 183 184 // //How to check the simplify function? A map gives no information 185 // //on the question whether a given key is or is not stored in it, or 186 // //it does? 187 // Yes, it does, using the find() function. 188 e=((p1+p2)+(p1p2)); 189 e.simplify(); 190 buf << "Coeff. of p2 should be 0"; 191 // std::cout<<e[p1]<<e[p2]<<e[p3]<<std::endl; 192 check(e.find(p2)==e.end(), buf.str()); 193 194 195 196 197 e=((p1+p2)+(p10.99*p2)); 198 double tolerance=0.001; 199 e.simplify(tolerance); 200 buf << "Coeff. of p2 should be 0.01"; 201 check(e[p2]>0, buf.str()); 202 203 tolerance=0.02; 204 e.simplify(tolerance); 205 buf << "Coeff. of p2 should be 0"; 206 check(e.find(p2)==e.end(), buf.str()); 207 208 178 209 } 179 210
Note: See TracChangeset
for help on using the changeset viewer.