Initializing help system before first use

XPRBnewsosw

XPRBnewsosw


Purpose
Create a SOS, using weights.
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:
XPRB_S1 
Special Ordered Set of type 1;
XPRB_S2 
Special Ordered Set of type 2.
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

© 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.