CPXXgetx and CPXgetx

The routine CPXXgetx/CPXgetx accesses the solution values for a range of problem variables.

int  CPXXgetx( CPXCENVptr env, CPXCLPptr lp, double * x, CPXDIM begin, CPXDIM end )

int  CPXgetx( CPXCENVptr env, CPXCLPptr lp, double * x, int begin, int end )

Description

The routine CPXXgetx/CPXgetx accesses the solution values for a range of problem variables. The beginning and end of the range must be specified.

Note: If the solution was obtained by the dual simplex algorithm and is not dual feasible then the function returns values with respect to the dual phase I bounds. 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.
x
An array to receive the values of the primal variables for the problem. This array must be of length at least (end-begin+1). If successful, x[0] through x[end-begin] contains the solution values.
begin
An integer specifying the beginning of the range of variable values to be returned.
end
An integer specifying the end of the range of variable values to be returned.

Return

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

Example


status = CPXgetx (env, lp, x, 0, CPXgetnumcols(env, lp)-1);

See also the example lpex2.c in the CPLEX User's Manual and in the standard distribution.