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.
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]throughpi[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);