CPXXgetsosname and CPXgetsosname
Accesses a range of names of special ordered sets (SOS) in a CPLEX problem object.
int CPXXgetsosname( CPXCENVptr env, CPXCLPptr lp, char ** name, char * namestore, CPXSIZE storespace, CPXSIZE * surplus_p, CPXDIM begin, CPXDIM end )
int CPXgetsosname( CPXCENVptr env, CPXCLPptr lp, char ** name, char * namestore, int storespace, int * surplus_p, int begin, int end )
Description
The routine
CPXXgetsosname/CPXgetsosname
accesses a range of names of
special ordered sets (SOS) in a CPLEX problem object.
As arguments to this routine, you must specify the
beginning of the range, the end of the range, and the length of the array in which
CPLEX returns the SOS names.
CPXERR_NEGATIVE_SURPLUS, then
the value in *surplus_p
is negative and specifies the difference between the memory
provided and the memory required (in bytes).
Arguments
- env
-
A pointer to the CPLEX environment as returned by
CPXXopenCPLEX/CPXopenCPLEX. - lp
-
A pointer to a CPLEX problem object as returned by
CPXXcreateprob/CPXcreateprob. - name
-
An array of pointers to the SOS names stored in the
array
namestore. This array must be of length at least (end-begin+1). This routine returns the pointer to the name of SOSiinname[i-begin]. - namestore
-
An array of characters where the requested SOS names are to be returned.
This argument can be
NULLifstorespaceis 0 (zero). - storespace
-
An integer specifying the length of the array
namestore. This argument can be 0 (zero). - surplus_p
-
A pointer to an integer to contain the difference between
storespaceand the total amount of memory required to store the requested names. A nonnegative value of*surplus_pspecifies thatstorespacewas sufficient. A negative value reports that it was insufficient and that consequently the routine could not complete its task. In that case,CPXXgetsosname/CPXgetsosnamereturns the valueCPXERR_NEGATIVE_SURPLUS, and the negative value of*surplus_pspecifies an upper limit on the amount of insufficient space in the arraynamestore. - begin
- An integer specifying the beginning of the range of SOS names to be returned.
- end
- An integer specifying the end of the range of SOS names to be returned.
Return
The routine returns 0 (zero) if successful and nonzero if an error occurs.
The value CPXERR_NEGATIVE_SURPLUS
reports that insufficient space was available in the array
namestore to hold the names.
Example
status = CPXgetsosname (env, lp, cur_sosname, cur_sosnamestore,
cur_storespace, &surplus, 0,
cur_numsos-1);