NO FRAMES

CPXgetslack

public int CPXgetslack(CPXCENVptr env, CPXCLPptr lp, double * slack, int begin, int end)
Definition file: cplex.h

The routine CPXgetslack accesses the slack values for a range of linear constraints. The beginning and end of the range must be specified. Except for ranged rows, the slack values returned consist of the righthand side minus the row activity level. For ranged rows, the value returned is the row activity level minus the righthand side, or, equivalently, the value of the internal structural variable that CPLEX creates to represent ranged rows.

Example

 status = CPXgetslack (env, lp, slack, 0, CPXgetnumrows(env,lp)-1);

Parameters:

env

A pointer to the CPLEX environment as returned by CPXopenCPLEX.

lp

A pointer to a CPLEX problem object as returned by CPXcreateprob.

slack

An array to receive the values of the slack or surplus variables for each of the constraints. This array must be of length at least (end - begin + 1). If successful, slack[0] through slack[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.

Example

 status = CPXgetslack (env, lp, slack, 0, CPXgetnumrows(env,lp)-1);

Returns:

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