Purpose
Create a
precedence constraint
v1 + dur
v2.
Synopsis
XPRBctr XPRBnewprec(XPRBprob prob, const char *name, XPRBvar v1,
double dur, XPRBvar v2);
Arguments
prob
|
Reference to a problem.
|
name
|
The constraint name (of unlimited length). May be NULL if not required.
|
v1
|
Reference to a variable.
|
dur
|
Double or integer constant.
|
v2
|
Reference to a variable.
|
Return value
Reference to the new constraint if function executed successfully, NULL otherwise.
Example
The following creates the inequality constraint ty1[2] + 5.4 <= ty1[4].
XPRBprob prob;
XPRBctr ctr5;
XPRBarrvar ty1;
...
ty1 = XPRBnewarrvar(prob, 5, XPRB_PL, "arry1", 0, 500);
ctr5 = XPRBnewprec(prob, "r5", ty1[2], 5.4, ty1[4]);
Further information
This function creates a so-called precedence constraint (where the variable plus constant is not larger than a second variable).
This function replaces
XPRBnewctr and
XPRBaddterm. If the indicated name is already in use, BCL adds an index to it. If no constraint name is given, BCL generates a default
name starting with
CTR.
Related topics
If you have any comments or suggestions about these pages,
please send mail to docs@dashoptimization.com.