Initializing help system before first use

XPRBaddqterm

XPRBaddqterm


Purpose
Add a quadratic term to a constraint.
Synopsis
int XPRBaddqterm(XPRBctr ctr, XPRBvar var1, XPRBvar var2, double coeff);
Arguments
ctr 
Reference to a constraint.
var1 
Reference to a variable.
var2 
Reference to a variable (not necessarily different).
coeff 
Value to be added to the coefficient of the term var1 * var2.
Return value
0 if function executed successfully, 1 otherwise.
Example
The following example adds the term -2*x2*x4 to the constraint ctr1:
XPRBctr ctr1;
XPRBvar x2,x4;
 ...
ctr1 = XPRBnewctr(prob, "r1", XPRB_L);
x2 = XPRBnewvar(prob, XPRB_PL, "abc1", 0, XPRB_INFINITY);
x4 = XPRBnewvar(prob, XPRB_PL, "abc5",0 , XPRB_INFINITY);
XPRBaddqterm(ctr1, x2, x4, -2); 
Further information
This function adds a new quadratic term to a constraint, comprising the product of the variables var1 and var2 with coefficient coeff. If the constraint already has a term with variables var1 and var2, coeff is added to its coefficient.
Note:
all terms that are added to a constraint must belong to the same problem as the constraint itself.

Related topics

© 2001-2019 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.