Initializing help system before first use

XPRBsetqterm

XPRBsetqterm


Purpose
Set a quadratic constraint term.
Synopsis
int XPRBsetqterm(XPRBctr ctr, XPRBvar var1, XPRBvar var2, double coeff);
Arguments
ctr 
Reference to a previously defined constraint.
var1 
Reference to a variable.
var2 
Reference to a variable (not necessarily different from first variable).
coeff 
Value to be added to the coefficient of the term var1 * var2.
Return value
0 if function executed successfully, 1 otherwise.
Example
XPRBprob prob;
XPRBvar x2;
XPRBctr ctr1;
 ...
ctr1 = XPRBnewctr(prob, "r1", XPRB_L);
x2 = XPRBnewvar(prob, XPRB_PL, "abc1", 0, XPRB_INFINITY);
XPRBaddqterm(ctr1, x2, x2, 1);
XPRBsetqterm(ctr1, x2, x2, 5.2); 
This sets the coefficient of the term x2*x2 to 5.2.
Further information
This function sets the coefficient of a quadratic term in a constraint to the value coeff.
Note:
all terms that are added to a constraint must belong to the same problem as the constraint itself.

Related topics