test/lp_test.cc
changeset 2382 678bea23ed75
parent 2363 2aabce558574
child 2386 81b47fc5c444
equal deleted inserted replaced
19:92249a78b821 20:456cbe034c85
   289   lp.addRow(x1-x2 >=-1);  
   289   lp.addRow(x1-x2 >=-1);  
   290   //Nonnegativity of the variables
   290   //Nonnegativity of the variables
   291   lp.colLowerBound(x1, 0);
   291   lp.colLowerBound(x1, 0);
   292   lp.colLowerBound(x2, 0);
   292   lp.colLowerBound(x2, 0);
   293   //Objective function
   293   //Objective function
   294   lp.setObj(x1+x2);
   294   lp.obj(x1+x2);
   295 
   295 
   296   lp.max();
   296   lp.max();
   297 
   297 
   298 
   298 
   299   //Testing the problem retrieving routines
   299   //Testing the problem retrieving routines
   300   check(lp.objCoeff(x1)==1,"First term should be 1 in the obj function!");
   300   check(lp.objCoeff(x1)==1,"First term should be 1 in the obj function!");
   301   check(lp.is_max(),"This is a maximization!");
   301   check(lp.isMax(),"This is a maximization!");
   302   check(lp.coeff(upright,x1)==1,"The coefficient in question is 1!");
   302   check(lp.coeff(upright,x1)==1,"The coefficient in question is 1!");
   303   //  std::cout<<lp.colLowerBound(x1)<<std::endl;
   303   //  std::cout<<lp.colLowerBound(x1)<<std::endl;
   304   check(  lp.colLowerBound(x1)==0,"The lower bound for variable x1 should be 0.");
   304   check(  lp.colLowerBound(x1)==0,"The lower bound for variable x1 should be 0.");
   305   check(  lp.colUpperBound(x1)==LpSolverBase::INF,"The upper bound for variable x1 should be infty.");
   305   check(  lp.colUpperBound(x1)==LpSolverBase::INF,"The upper bound for variable x1 should be infty.");
   306   LpSolverBase::Value lb,ub;
   306   LpSolverBase::Value lb,ub;