Initializing help system before first use

XPRBnewprec

XPRBnewprec


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 ty12 + 5.4 ≤ ty14.
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 first 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. (The generation of unique names will only take place if the names dictionary is enabled, see XPRBsetdictionarysize.)
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.