CPXXgetindconstrname and CPXgetindconstrname

The routine CPXXgetindconstrname/CPXgetindconstrname accesses the name of a specified indicator constraint of a CPLEX problem object.

int  CPXXgetindconstrname( CPXCENVptr env, CPXCLPptr lp, char * buf_str, CPXSIZE bufspace, CPXSIZE * surplus_p, CPXDIM which )

int  CPXgetindconstrname( CPXCENVptr env, CPXCLPptr lp, char * buf_str, int bufspace, int * surplus_p, int which )

Description

The routine CPXXgetindconstrname/CPXgetindconstrname accesses the name of a specified indicator constraint of a CPLEX problem object.

Note: If the routine returns 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.
buf_str
A pointer to a buffer of size bufspace. Can be NULL if bufspace is 0 (zero).
bufspace
An integer specifying the length of the array buf_str. Can be 0 (zero).
surplus_p
A pointer to an integer to contain the difference between bufspace and the amount of memory required to store the indicator constraint name. A nonnegative value of *surplus_p reports that the length of the array buf_str was sufficient. A negative value reports that the length of the array was insufficient and that the routine could not complete its task. In this case, CPXXgetindconstrname/CPXgetindconstrname returns the value CPXERR_NEGATIVE_SURPLUS, and the negative value of *surplus_p specifies an upper limit on the amount of insufficient space in the array buf_str.
which
An integer specifying the index of the indicator constraint for which the name is to be returned.

Return

The routine returns 0 (zero) if successful and nonzero

Example


 status = CPXgetindconstrname (env, lp, indname, lenindname,
                               &surplus, 5);
 
if an error occurs. The value CPXERR_NEGATIVE_SURPLUS reports that insufficient space was available in the buf_str array to hold the indicator constraint name.