CPXXgetindconstrinfeas and CPXgetindconstrinfeas

The routine CPXXgetindconstrinfeas/CPXgetindconstrinfeas computes the infeasibility of a given solution for a range of indicator constraints.

int  CPXXgetindconstrinfeas( CPXCENVptr env, CPXCLPptr lp, double const * x, double * infeasout, CPXDIM begin, CPXDIM end )

int  CPXgetindconstrinfeas( CPXCENVptr env, CPXCLPptr lp, double const * x, double * infeasout, int begin, int end )

Description

The routine CPXXgetindconstrinfeas/CPXgetindconstrinfeas computes the infeasibility of a given solution for a range of indicator constraints. The beginning and end of the range must be specified. For each constraint, the infeasibility value returned is 0 (zero) if the constraint is satisfied. In particular, the infeasibility value returned is 0 (zero) if the indicator constraint is not active in the queried solution. Otherwise, the infeasibility value returned is the amount by which the righthand side of the linear portion of the constraint must be changed to make the queried solution valid. It is positive for a less-than-or-equal-to constraint, negative for a greater-than-or-equal-to constraint, and can be of any sign for an equality constraint.

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.
x
The solution whose infeasibility is to be computed. Can be NULL in which case the resident solution is used.
infeasout
An array to receive the infeasibility value for each of the indicator constraints. This array must be of length at least (end-begin+1).
begin
An integer specifying the beginning of the range of indicator constraints whose infeasibility is to be returned.
end
An integer specifying the end of the range of indicator constraints whose infeasibility is to be returned.

Return

The routine returns 0 (zero) if successful and nonzero if an error occurs.

Example


 status = CPXgetindconstrinfeas (env, lp, NULL, infeasout, 0, CPXgetnumindconstrs(env,lp)-1);