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.

◆ qp indicates that you want <strong>ILOG</strong> <strong>CPLEX</strong> to treat the problem as a QP. This change inProblem Type creates in your problem an empty quadratic matrix, if there is not onealready present, for the objective function, ready for populating via the change qptermcommand.From the Callable Library, use the routine CPXchgprobtype to change the Problem Type toeither CPXPROB_LP or CPXPROB_QP for the LP and QP case, respectively, for the samepurposes.Changing Quadratic Terms<strong>ILOG</strong> <strong>CPLEX</strong> distinguishes between a quadratic algebraic term and a quadratic matrixcoefficient. The quadratic algebraic terms are the coefficients that appear in the algebraicexpression defined as part of the <strong>ILOG</strong> <strong>CPLEX</strong> LP format. The quadratic matrix coefficientsappear in Q. The quadratic coefficient of an off-diagonal term must be distributed within theQ matrix, and it is always one-half the value of the quadratic algebraic term.To clarify that terminology, consider this example:Minimize a+b +1/2(a 2 + 4ab + 7b 2 )subject to a +b≥ 10with these bounds a ≥ 0 and b ≥ 0The off-diagonal quadratic algebraic term in that example is 4, so the quadratic matrix Q is◆◆1227In a QP, you can change the quadratic matrix coefficients in the Interactive Optimizer byusing the command change qpterm.From the Callable Library, use the routine CPXchgqpcoef to change quadratic matrixcoefficients.◆ Concert Technology does not support direct editing of expressions other than linearexpressions. Consequently, to change a quadratic objective function, you need to createan expression with the modified quadratic objective and use the setExpr method ofIloObjective to install it.Changing an off-diagonal element changes the corresponding symmetric element as well. Inother words, if a call to CPXchgqpcoef changes Q ij to a value, it also changes Q ji to thatsame value.<strong>ILOG</strong> <strong>CPLEX</strong> <strong>11.0</strong> — USER’ S MANUAL 233

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

Saved successfully!

Ooh no, something went wrong!