CPXXslackfromx and CPXslackfromx

The routine CPXXslackfromx/CPXslackfromx computes an array of slack values from primal solution values.

int  CPXXslackfromx( CPXCENVptr env, CPXCLPptr lp, double const * x, double * slack )

int  CPXslackfromx( CPXCENVptr env, CPXCLPptr lp, double const * x, double * slack )

Description

Warning:

This is an advanced routine. Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX. Thus they incur a higher risk of incorrect behavior in your application, behavior that can be difficult to debug. Therefore, the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead.

The routine CPXXslackfromx/CPXslackfromx computes an array of slack values from primal solution values.

Arguments

env
A pointer to the CPLEX environment, as returned by CPXXopenCPLEX/CPXopenCPLEX.
lp
A pointer to a CPLEX LP problem object, as returned by CPXXcreateprob/CPXcreateprob.
x
An array that contains primal solution (x) values for the problem, as returned by routines such as CPXXcrushx/CPXcrushx and CPXXuncrushx/CPXuncrushx. The array must be of length at least the number of columns in the LP problem object.
slack
An array to receive the slack values computed from the x values for the problem object. The array must be of length at least the number of rows in the LP problem object.

Return

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

Example


status = CPXslackfromx (env, lp, x, slack);