CPXXgetobj and CPXgetobj
The routine CPXXgetobj/CPXgetobj accesses a range of
objective function coefficients of a CPLEX problem object.
int CPXXgetobj( CPXCENVptr env, CPXCLPptr lp, double * obj, CPXDIM begin, CPXDIM end )
int CPXgetobj( CPXCENVptr env, CPXCLPptr lp, double * obj, int begin, int end )
Description
The routine CPXXgetobj/CPXgetobj accesses a range of
objective function coefficients of a CPLEX problem object. The beginning and
end of the range must be specified.
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. - obj
-
An array where the specified objective coefficients are to be returned. This array must be of length at least (
end-begin+1). The objective function coefficient of variablejis returned inobj[j-begin]. May be NULL if querying an empty range (i.e., if begin > end). - begin
- An integer specifying the beginning of the range of objective function coefficients to be returned.
- end
- An integer specifying the end of the range of objective function coefficients to be returned.
Return
The routine returns 0 (zero) if successful and nonzero if an error occurs.Example
status = CPXgetobj (env, lp, obj, 0, cur_numcols-1);