lemon/lp_cplex.cc
changeset 1460 7c58aabb9eea
parent 1458 7a483c1d38b5
child 1473 876c7b7f4dae
equal deleted inserted replaced
2:b867f31caee3 3:f82ad50a63f8
   258     else{
   258     else{
   259       return UNSOLVED;
   259       return UNSOLVED;
   260     }
   260     }
   261   }
   261   }
   262 
   262 
       
   263   LpCplex::Value LpCplex::_getPrimal(int i)
       
   264   {
       
   265     Value x;
       
   266     CPXgetx (env, lp, &x, i, i);
       
   267     return x;
       
   268   }
       
   269   
       
   270   LpCplex::Value LpCplex::_getPrimalValue()
       
   271   {
       
   272     Value objval;
       
   273     //method = CPXgetmethod (env, lp);
       
   274     status = CPXgetobjval (env, lp, &objval);
       
   275     return objval;
       
   276   }
       
   277   
   263 
   278 
   264 //7.5-os cplex statusai (Vigyazat: a 9.0-asei masok!)
   279 //7.5-os cplex statusai (Vigyazat: a 9.0-asei masok!)
   265 // This table lists the statuses, returned by the CPXgetstat() routine, for solutions to LP problems or mixed integer problems. If no solution exists, the return value is zero.
   280 // This table lists the statuses, returned by the CPXgetstat() routine, for solutions to LP problems or mixed integer problems. If no solution exists, the return value is zero.
   266 
   281 
   267 // For Simplex, Barrier  
   282 // For Simplex, Barrier  
   375     default:
   390     default:
   376       return UNDEFINED; //Everything else comes here
   391       return UNDEFINED; //Everything else comes here
   377       //FIXME error
   392       //FIXME error
   378     }
   393     }
   379 
   394 
   380   LpCplex::Value LpCplex::_getPrimal(int i)
       
   381   {
       
   382     Value x;
       
   383     CPXgetx (env, lp, &x, i, i);
       
   384     return x;
       
   385   }
       
   386   
       
   387   LpCplex::Value LpCplex::_getPrimalValue()
       
   388   {
       
   389     Value objval;
       
   390     //method = CPXgetmethod (env, lp);
       
   391     status = CPXgetobjval (env, lp, &objval);
       
   392     return objval;
       
   393   }
       
   394   
       
   395  
   395  
       
   396   LpCplex::ProblemTypes LpCplex::_getProblemType()
       
   397   {
       
   398     int stat = CPXgetstat (env, lp);
       
   399     switch (stat) {
       
   400     case CPX_OPTIMAL://Optimal
       
   401 	return PRIMAL_DUAL_FEASIBLE;
       
   402     case CPX_UNBOUNDED:
       
   403  	return PRIMAL_FEASIBLE_DUAL_INFEASIBLE;
       
   404 // 	return PRIMAL_INFEASIBLE_DUAL_FEASIBLE;
       
   405 // 	return PRIMAL_DUAL_INFEASIBLE;
       
   406 
       
   407 //Seems to be that this is all we can say for sure
       
   408     default:
       
   409 	//In all other cases
       
   410 	return UNKNOWN;
       
   411       //FIXME error
       
   412     }
   396 
   413 
   397 
   414 
   398   void LpCplex::_setMax()
   415   void LpCplex::_setMax()
   399   {
   416   {
   400     CPXchgobjsen (env, lp, CPX_MAX);
   417     CPXchgobjsen (env, lp, CPX_MAX);