XPRBnewsosw
PurposeSynopsisXPRBsos 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:
XPRB_S1 XPRB_S2 av An array of variables. weight An array of weights. May be NULL if not required.Return valueReference to the new SOS if function executed successfully, NULL otherwise.ExampleThe 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 informationThis 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.Related topics
If you have any comments or suggestions about these pages, please send mail to docs@dashoptimization.com.