Overview | Group | Index | Concepts |
The routine CPXaddsos
adds information about
a special ordered set (SOS)
to a problem object of type CPXPROB_MILP
,
CPXPROB_MIQP
, or
CPXPROB_MIQCP
.
The problem may already contain SOS information.
CPX_TYPE_SOS1 | '1' | Type 1 |
CPX_TYPE_SOS2 | '2' | Type 2 |
The arrays sosbeg
, sosind
, and soswts
follow the same conventions as similar arrays in other routines of the
Callable Library.
For j < numsos-1
, the indices of
the set j
must
be stored in sosind[sosbeg[j]],
..., sosind[sosbeg[j+1]-1]
and the weights in
soswt[sosbeg[j],
..., soswt[sosbeg[j+1]-1]
. For
the last set, j = numsos-1
, the indices must be stored in
sosind[sosbeg[numsos-1]],
..., sosind[numsosnz-1]
and the corresponding weights in
soswt[sosbeg[numsos-1]],
..., soswt[numsosnz-1]
.
Hence, the length of sosbeg
must be at least
numsos
, while the lengths of sosind
and
soswt
must must be at least numsosnz
.
Example
status = CPXaddsos (env, lp, numsos, numsosnz, sostype, sosbeg, sosind, soswt, NULL);
env | A pointer to the CPLEX environment as returned by |
lp | A pointer to a CPLEX problem object as returned by |
numsos | The number of sets to be added to existing SOS sets, if any. |
numsosnz | The total number of members in all of the sets to be added to existing SOS sets, if any. |
sostype | An array containing SOS type information for the sets to be added. According to Table 1, |
sosbeg | An array that with |
sosind | An array that with |
soswt | An array that with |
sosname | An array containing pointers to character strings that represent the names of the new SOSs. May be NULL, in which case the new SOSs are assigned default names if the SOSs already resident in the CPLEX problem object have names; otherwise, no names are associated with the sets. If SOS names are passed to |