XPRBnewctr
XPRBnewctr |
Purpose
Synopsis
XPRBctr XPRBnewctr(XPRBprob prob, const char *name, int qrtype);
Arguments
prob
|
Reference to a problem.
|
||||||||
name
|
The constraint name (of unlimited length). May be
NULL if not required.
|
||||||||
type
|
Type of the constraint, which must be one of
|
Return value
Reference to the new constraint if function executed successfully,
NULL otherwise.
Example
The following creates a new equality constraint.
XPRBprob prob; XPRBctr ctr1; ... ctr1 = XPRBnewctr(prob, "r1", XPRB_E);
Further information
This function creates a new constraint and returns the reference to this constraint,
i.e., the constraint's model name. It has to be called before
XPRBaddterm or
XPRBaddqterm is used to add terms to the constraint. Range constraints can first be created with any type and then converted using the function
XPRBsetrange. 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.)
Related topics