Previous Page: CPXcopyquadFirst PageNext Page: CPXcopystart

CPXcopysos


Usage

Mixed Integer Users Only

Description

The routine CPXcopysos() is used to copy SOS information to a problem object of type CPXPROB_MIP.

Return Value

The routine returns a zero on success, and a nonzero if an error occurs.

Synopsis

int CPXcopysos (CPXENVptr env,
                CPXLPptr lp,
                int numsos,
                int numsosnz,
                char *sostype,
                int *sospri,
                int *sosbeg,
                int *sosind,
                double *sosref);

Arguments


CPXENVptr env
The pointer to the CPLEX environment as returned by one of the CPXopenCPLEX routines.

CPXLPptr lp
A pointer to a CPLEX LP problem object as returned by CPXcreateprob().

int numsos
The number of SOS sets.

int numsosnz
The total number of members in all sets.

char *sostype
An array containing SOS type information for the sets. sostype[i] specifies the SOS type of set i:

CPX_TYPE_SOS1  
`1'  
Type 1  
CPX_TYPE_SOS2  
`2'  
Type 2  

This array must be of length at least numsos.

int *sospri
An array containing priority values for each set. sospri[i] specifies the priority for set i, and may take any nonnegative value. This array may be NULL; otherwise it must be of length at least numsos.

int *sosbeg
int *sosind
double *sosref
These three arguments are all arrays describing the indices and reference row values for the sets. The indices and reference row values must be stored in sequential locations in sosind and sosref, respectively, with sosbeg[j] containing the index of the beginning of set j. For j < numsos-1 the indices of set j must be stored in sosind[sosbeg[j]], ..., sosind[sosbeg[j+1]-1] and the reference row values in sosref[sosbeg[j], ..., sosref[sosbeg[j+1]-1]. For the last set,j = numsos-1, the indices must be stored insosind[sosbeg[numsos-1]], ..., sosind[sosbeg[numsosnz-1]]and the corresponding reference row values insosref[sosbeg[numsos-1]], ..., sosref[sosbeg[numsosnz-1]]. Hence, sosbeg must be of length at least numsos, while sosind and sosref must must be of length at least numsosnz.

Example

status = CPXcopysos (env, lp, numsos, numsosnz, sostype, sospri,
                     sosbeg, sosind, sosref);

See Also

CPXreadcopysos(), which reads an SOS file and also copies the SOS data.

Example mipex3.c in the CPLEX User's Manual.

Previous Page: CPXcopyquadFirst PageNext Page: CPXcopystart