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.

The class IloNumVar provides methods that allow querying of the data needed to specify avariable. However, only bounds can be modified. Concert Technology provides a modelingobject class IloConversion to change the type of a variable. This conversion allows you touse the same variable with different types in different models.Variables are usually used to build up expressions, which in turn are used to define theobjective or constraints of the optimization problem. An expression can be explicitly written,as in1*x[1] + 2*x[2] + 3*x[3]where x is assumed to be an array of variables (IloNumVarArray). Expressions can also becreated piece by piece, with a loop:IloExpr expr(env);for (int i = 0; i < x.getSize(); ++i)expr += data[i] * x[i];Whenever possible, build your expressions in terms of data that is either integer ordouble-precision (64-bit) floating point. Single-precision (32-bit) floating point data shouldbe avoided, as it can result in unnecessarily ill conditioned problems. For more information,refer to Numeric Difficulties on page 185.While Concert Technology supports very general expressions, only linear, quadratic,piecewise-linear, and logical expressions can be used in models to be solved withIloCplex. For more about each of those possibilities, see these chapters of this manual:●●●Solving LPs: Simplex Optimizers on page 171 and Solving LPs: Barrier Optimizer onpage 197 both discuss linear expressions.Solving Problems with a Quadratic Objective (QP) on page 227 discusses quadraticexpressions in an objective function.Solving Problems with Quadratic Constraints (QCP) on page 239 discusses quadraticexpressions in quadratically constrained programming problems (QCPs), includingthe special case of second order cone programming (SOCP) problems.● Using Piecewise Linear Functions in Optimization: a Transport Example on page 337introduces piecewise-linear expressions through a transportation example.● Logical Constraints in Optimization on page 349 introduces logical constraintshandled by <strong>ILOG</strong> <strong>CPLEX</strong>. Chapters following it offer examples.When you have finished using an expression (that is, you created a constraint with it) youneed to delete it by calling its method end, for example:expr.end();Declaring the Objective: IloObjectiveObjects of class IloObjective represent objective functions in optimization models.IloCplex may only handle models with at most one objective function, though the<strong>ILOG</strong> <strong>CPLEX</strong> <strong>11.0</strong> — USER’ S MANUAL 47

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

Saved successfully!

Ooh no, something went wrong!