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.
IloObjective::setExpr()
to install this new expression in the model's objective.
Changing an off-diagonal element changes the corresponding symmetric element as well. In other words, if a call to CPXchgqpcoef()
changes Q(i, j) to a value, it also changes Q(j, i) 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.