Once the optimization problem has been created in an IloModel
object, it is time to create the IloCplex
object for solving the problem. This is done by creating a variable of type IloCplex
. For example, to create an object named cplex
, do the following:
IloCplex cplex(env); |
IloCplex cplex(model); |
cplex.solve(); |
This method returns an IloBool
value, where IloTrue
indicates that cplex
successfully found a feasible (yet not necessarily optimal) solution, and IloFalse
indicates that no solution was found. More precise information about the outcome of the last call to method solve()
can be obtained by calling:
The returned value tells you what CPLEX found out about the model: whether it found the optimal solution or only a feasible solution, whether it proved the model to be unbounded or infeasible, or whether nothing at all has been determined at this point. Even more detailed information about the termination of the solve call is available through method IloCplex::getCplexStatus()
.