To clarify that terminology, consider this example:
Minimize a + b + 1/2(a2 + 4ab + 7b2)
The off-diagonal quadratic algebraic term in that example is 4, so the quadratic matrix Q is
change qpterm
.
CPXchgqpcoef()
to change quadratic matrix coefficients.
setExpr()
method of IloObjective
to install.
Changing an off-diagonal element changes the corresponding symmetric element as well. In other words, if a call to CPXchgqpcoef()
changes Qij to a value, it also changes Qji to that same value.
If you have entered a linear problem without any quadratic terms, and you want to create quadratic terms, you must first change the Problem Type to QP. To do so, use the command change problem qp
. This command will create an empty quadratic matrix with Q = 0.