CPXXgetpi and CPXgetpi

The routine CPXXgetpi/CPXgetpi accesses the dual values for a range of the constraints of a linear or quadratic program.

int  CPXXgetpi( CPXCENVptr env, CPXCLPptr lp, double * pi, CPXDIM begin, CPXDIM end )

int  CPXgetpi( CPXCENVptr env, CPXCLPptr lp, double * pi, int begin, int end )

Description

The routine CPXXgetpi/CPXgetpi accesses the dual values for a range of the constraints of a linear or quadratic program. The beginning and end of the range must be specified.

The arguments returned by this routine are meaningful not only for linear programs, but also for second order cone programs. They provide information about the dual solution. In the CPLEX User's Manual the topic Accessing dual values and reduced costs of SOCP shows how to use the values returned by this routine for second order cone programs.

Note: If the solution was obtained by the primal simplex algorithm and is not primal feasible then the function returns values with respect to the primal phase I objective. You can use CPXXsolninfo and CPXsolninfo to query primal and dual feasibility of a solution.

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.
pi
An array to receive the values of the dual variables for each of the constraints. This array must be of length at least (end-begin+1). If successful, pi[0] through pi[end-begin] contain the dual values.
begin
An integer specifying the beginning of the range of dual values to be returned.
end
An integer specifying the end of the range of dual values to be returned.

Return

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

Example


status = CPXgetpi (env, lp, pi, 0, CPXgetnumrows(env,lp)-1);