Previous Page: CPXgetsenseFirst PageNext Page: CPXgetsos

CPXgetslack


Description

The routine CPXgetslack() is used to access the slack values for a range of the constraints of a linear or quadratic program. The beginning and end of the range must be specified. Except for ranged rows, the slack values returned consist of the right-hand side minus the row activity level. For ranged rows, the value returned will be the row activity level minus the right-hand side, or, equivalently, the value of the internal structural variable that CPLEX creates to represent ranged rows.

Return Value

The routine returns a zero on success, and a nonzero if an error occurs.

Synopsis

int CPXgetslack (CPXENVptr env,
                 CPXLPptr lp,
                 double *slack,
                 int begin,
                 int end);

Arguments


CPXENVptr env
The pointer to the CPLEX environment as returned by one of the CPXopenCPLEX routines.

CPXLPptr lp
A pointer to a CPLEX LP problem object as returned by CPXcreateprob().

double *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] will contain the values of the slacks.

int begin
An integer indicating the beginning of the range of slack values to be returned.

int end
An integer indicating the end of the range of slack values to be returned.

Example

status = CPXgetslack (env, lp, slack, 0, CPXgetnumrows(env,lp)-1);
Previous Page: CPXgetsenseFirst PageNext Page: CPXgetsos