XPRBnewsosw
XPRBnewsosw |
Purpose
Synopsis
XPRBsos XPRBnewsosw(XPRBprob prob, const char *name, int type, XPRBarrvar av, double *weight);
Arguments
prob
|
Reference to a problem.
|
||||
name
|
The set name.
|
||||
type
|
The set type, which must be one of:
|
||||
av
|
An array of variables.
|
||||
weight
|
An array of weights. May be
NULL if not required.
|
Return value
Reference to the new SOS if function executed successfully,
NULL otherwise.
Example
The following creates an SOS of type 1, with the variables in array
ty1 and weights,
cr.
XPRBprob prob; XPRBsos set1; XPRBarrvar ty1; double cr[] = {2.0, 13.0, 15.0, 6.0, 8.5}; ... ty1 = XPRBnewarrvar(prob, 5, XPRB_PL, "arry1", 0, 500); set1 = XPRBnewsosw(prob, "sos1", XPRB_S1, ty1, cr);
Further information
This function can be used instead of a stepwise SOS definition using functions
XPRBnewsos and
XPRBaddsosarrel, that is if the variables and their weights are available in the form of two arrays. If no weights are defined, the reference values of the variables are set to
1. If the indicated name is already in use, BCL adds an index to it. If no name is given for the set, BCL generates a default name starting with
SOS. (The generation of unique names will only take place if the names dictionary is enabled, see
XPRBsetdictionarysize.)
- Note:
- all members that are added to a SOS must belong to the same problem as the SOS itself.
Related topics