Changeset 2605:852361980706 in lemon-0.x for test
- Timestamp:
- 04/08/08 18:01:28 (17 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3488
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/lp_test.cc
r2571 r2605 21 21 #include "test_tools.h" 22 22 #include <lemon/tolerance.h> 23 #include <lemon/lp_utils.h> 23 24 24 25 #ifdef HAVE_CONFIG_H … … 217 218 { 218 219 LP::DualExpr e,f,g; 219 LP::Row p1,p2,p3,p4,p5; 220 LP::Row p1 = INVALID, p2 = INVALID, p3 = INVALID, 221 p4 = INVALID, p5 = INVALID; 220 222 221 223 e[p1]=2; … … 296 298 lp.max(); 297 299 298 299 300 //Testing the problem retrieving routines 300 301 check(lp.objCoeff(x1)==1,"First term should be 1 in the obj function!"); … … 308 309 check( lb==-LpSolverBase::INF,"The lower bound for the first row should be -infty."); 309 310 check( ub==1,"The upper bound for the first row should be 1."); 310 311 LpSolverBase::Expr e = lp.row(upright); 312 check( e.size() == 2, "The row retrieval gives back wrong expression."); 313 check( e[x1] == 1, "The first coefficient should 1."); 314 check( e[x2] == 1, "The second coefficient should 1."); 315 316 LpSolverBase::DualExpr de = lp.col(x1); 317 check( de.size() == 4, "The col retrieval gives back wrong expression."); 318 check( de[upright] == 1, "The first coefficient should 1."); 319 320 LpSolverBase* clp = lp.copyLp(); 321 322 //Testing the problem retrieving routines 323 check(clp->objCoeff(x1)==1,"First term should be 1 in the obj function!"); 324 check(clp->isMax(),"This is a maximization!"); 325 check(clp->coeff(upright,x1)==1,"The coefficient in question is 1!"); 326 // std::cout<<lp.colLowerBound(x1)<<std::endl; 327 check( clp->colLowerBound(x1)==0,"The lower bound for variable x1 should be 0."); 328 std::cerr << clp->colUpperBound(x1) << std::endl; 329 check( clp->colUpperBound(x1)==LpSolverBase::INF,"The upper bound for variable x1 should be infty."); 330 331 clp->getRowBounds(upright,lb,ub); 332 check( lb==-LpSolverBase::INF,"The lower bound for the first row should be -infty."); 333 check( ub==1,"The upper bound for the first row should be 1."); 334 e = clp->row(upright); 335 check( e.size() == 2, "The row retrieval gives back wrong expression."); 336 check( e[x1] == 1, "The first coefficient should 1."); 337 check( e[x2] == 1, "The second coefficient should 1."); 338 339 de = clp->col(x1); 340 check( de.size() == 4, "The col retrieval gives back wrong expression."); 341 check( de[upright] == 1, "The first coefficient should 1."); 342 343 delete clp; 311 344 312 345 //Maximization of x1+x2 … … 338 371 lp.min(); 339 372 check(lp.primalStatus()==LpSolverBase::UNDEFINED,"Primalstatus should be UNDEFINED"); 373 340 374 341 375 // lp.solve();
Note: See TracChangeset
for help on using the changeset viewer.