Overview | Group | Tree | Graph | 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 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, sospri, sosbeg, sosind, soswt);
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, |
sospri | An array containing priority values for each set to be added. |
sosbeg | An array that with |
sosind | An array that with |
soswt | An array that with |