CPXXgetindconstrslack and CPXgetindconstrslack
The routine CPXXgetindconstrslack/CPXgetindconstrslack accesses
the slack values for a range of indicator constraints.
int CPXXgetindconstrslack( CPXCENVptr env, CPXCLPptr lp, double * indslack, CPXDIM begin, CPXDIM end )
int CPXgetindconstrslack( CPXCENVptr env, CPXCLPptr lp, double * indslack, int begin, int end )
Description
The routine CPXXgetindconstrslack/CPXgetindconstrslack accesses
the slack values for a range of indicator constraints.
The beginning and end of the range must be specified.
Active indicator constraints
If an indicator constraint is
active, that is, x[i] = 1 where
x[i] implies that a*x <= b, then
this routine accesses indslack[i] = b -a*x.
Inactive indicator constraints
An indicator constraint is considered
inactive, and thus returns an
infinite slack value, when the corresponding indicator binary
takes a value less than the integrality tolerance
or greater than (1- the integrality tolerance)
if the indicator binary is complemented.
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. - indslack
-
An array to receive the slack values for each of the constraints. This array must be of length at least (
end-begin+1). If successful,indslack[0]throughindslack[end-begin]contain the values of the slacks. - begin
- An integer specifying the beginning of the range of slack values to be returned.
- end
- An integer specifying the end of the range of slack values to be returned.
Return
The routine returns 0 (zero) if successful and nonzero if an error occurs.Example
status = CPXgetindconstrslack (env, lp, indslack, 0, CPXgetnumindconstrs(env,lp)-1);