lemon/lp_cplex.cc
changeset 1460 7c58aabb9eea
parent 1458 7a483c1d38b5
child 1473 876c7b7f4dae
     1.1 --- a/lemon/lp_cplex.cc	Thu Jun 09 09:49:56 2005 +0000
     1.2 +++ b/lemon/lp_cplex.cc	Thu Jun 09 15:03:58 2005 +0000
     1.3 @@ -260,6 +260,21 @@
     1.4      }
     1.5    }
     1.6  
     1.7 +  LpCplex::Value LpCplex::_getPrimal(int i)
     1.8 +  {
     1.9 +    Value x;
    1.10 +    CPXgetx (env, lp, &x, i, i);
    1.11 +    return x;
    1.12 +  }
    1.13 +  
    1.14 +  LpCplex::Value LpCplex::_getPrimalValue()
    1.15 +  {
    1.16 +    Value objval;
    1.17 +    //method = CPXgetmethod (env, lp);
    1.18 +    status = CPXgetobjval (env, lp, &objval);
    1.19 +    return objval;
    1.20 +  }
    1.21 +  
    1.22  
    1.23  //7.5-os cplex statusai (Vigyazat: a 9.0-asei masok!)
    1.24  // 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.
    1.25 @@ -377,22 +392,24 @@
    1.26        //FIXME error
    1.27      }
    1.28  
    1.29 -  LpCplex::Value LpCplex::_getPrimal(int i)
    1.30 + 
    1.31 +  LpCplex::ProblemTypes LpCplex::_getProblemType()
    1.32    {
    1.33 -    Value x;
    1.34 -    CPXgetx (env, lp, &x, i, i);
    1.35 -    return x;
    1.36 -  }
    1.37 -  
    1.38 -  LpCplex::Value LpCplex::_getPrimalValue()
    1.39 -  {
    1.40 -    Value objval;
    1.41 -    //method = CPXgetmethod (env, lp);
    1.42 -    status = CPXgetobjval (env, lp, &objval);
    1.43 -    return objval;
    1.44 -  }
    1.45 -  
    1.46 - 
    1.47 +    int stat = CPXgetstat (env, lp);
    1.48 +    switch (stat) {
    1.49 +    case CPX_OPTIMAL://Optimal
    1.50 +	return PRIMAL_DUAL_FEASIBLE;
    1.51 +    case CPX_UNBOUNDED:
    1.52 + 	return PRIMAL_FEASIBLE_DUAL_INFEASIBLE;
    1.53 +// 	return PRIMAL_INFEASIBLE_DUAL_FEASIBLE;
    1.54 +// 	return PRIMAL_DUAL_INFEASIBLE;
    1.55 +
    1.56 +//Seems to be that this is all we can say for sure
    1.57 +    default:
    1.58 +	//In all other cases
    1.59 +	return UNKNOWN;
    1.60 +      //FIXME error
    1.61 +    }
    1.62  
    1.63  
    1.64    void LpCplex::_setMax()