12.07.2015 Views

ILOG CPLEX 11.0 User's Manual

ILOG CPLEX 11.0 User's Manual

ILOG CPLEX 11.0 User's Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

However, querying solution values variable by variable may result in ugly code. Here the useof Concert Technology arrays provides a much more compact way of accessing the solutionvalues. Assuming your variables are stored in an IloNumVarArray var, you can useIloNumArray x(env);cplex.getValues(x, var);to access the solution values for all variables in var at once. Value x[i] contains thesolution value for variable var[i].Solution data is not restricted to the solution values of variables. It also includes values ofslack variables in constraints (whether the constraints are linear or quadratic) and theobjective value. If the extracted model does not contain an objective object, IloCplexassumes a 0 expression objective. The objective value is returned by calling methodcplex.getObjValue. Slack values are accessed with the methods getSlack andgetSlacks, which take linear or quadratic constraints as a parameter.For LPs and QPs, solution data includes information such as dual variables and reduced cost.Such information can be queried with the methods, getDual, getDuals,getReducedCost, and getReducedCosts.Accessing Basis InformationWhen solving LPs or QPs with either the simplex algorithm or the barrier optimizer withcrossover enabled, basis information is available as well. Basis information can be consultedby the method IloCplex::getBasisStatuses which returns basis status information forvariables and constraints.Such information is encoded by the nested enumeration IloCplex::BasisStatus.Performing Sensitivity AnalysisThe availability of a basis for an LP allows you to perform sensitivity analysis for yourmodel, if it is an LP. Such analysis tells you by how much you can modify your modelwithout affecting the solution you found. The modifications supported by the sensitivityanalysis function include bound changes, changes of the right hand side vector and changesof the objective function. They are analyzed by methods IloCplex::getBoundSA,IloCplex::getRHSSA, and IloCplex::getObjSA, respectively.Analyzing Infeasible ProblemsAn important feature of <strong>ILOG</strong> <strong>CPLEX</strong> is that even if no feasible solution has been found,(that is, if cplex.solve returns IloFalse), some information about the problem can bequeried. All the methods discussed so far may successfully return information about thecurrent (infeasible) solution which <strong>ILOG</strong> <strong>CPLEX</strong> maintains.<strong>ILOG</strong> <strong>CPLEX</strong> <strong>11.0</strong> — USER’ S MANUAL 59

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!