CPXXgetqconstrdslack and CPXgetqconstrdslack

The routine CPXXgetqconstrdslack/CPXgetqconstrdslack accesses the dual slack values for a quadratic constraint.

int  CPXXgetqconstrdslack( CPXCENVptr env, CPXCLPptr lp, CPXDIM qind, CPXDIM * nz_p, CPXDIM * ind, double * val, CPXDIM space, CPXDIM * surplus_p )

int  CPXgetqconstrdslack( CPXCENVptr env, CPXCLPptr lp, int qind, int * nz_p, int * ind, double * val, int space, int * surplus_p )

Description

The routine CPXXgetqconstrdslack/CPXgetqconstrdslack accesses the dual slack values for a quadratic constraint. It retrieves the dual slack for the specified constraint in the current (optimal) solution. The dual slack is returned as a sparse vector of nonzero coefficients in the dual slack vector.

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.
qind
Index of the quadratic constraint for which the dual slack is to be queried.
nz_p
Where to store the number of nonzero elements returned in ind and val. If the function returns either 0 (zero) or CPXERR_NEGATIVE_SURPLUS, then this value contains the number of elements that were stored in ind or val. Otherwise, the value is either unchanged or set to 0 (zero).
ind
Where to store the indices of nonzero coefficients returned by this function. May be NULL if space is nonpositive.
val
Where to store the values of nonzero coefficients returned by this function. May be NULL if space is nonpositive.
space
The number of elements available in ind and val, respectively.
surplus_p
A pointer to an integer to contain the difference between space and the number of entries in each of the arrays ind and val. A nonnegative value of surplus_p specifies that the length of the arrays was sufficient. A negative value specifies that the length was insufficient and that the routine could not complete its task. In this case, CPXXgetqconstrdslack/CPXgetqconstrdslack returns the value CPXERR_NEGATIVE_SURPLUS, and the negative value of surplus_p specifies the amount of insufficient space in the arrays.

Return

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