CPXXgetobjval and CPXgetobjval

The routine CPXXgetobjval/CPXgetobjval accesses the solution objective value.

int  CPXXgetobjval( CPXCENVptr env, CPXCLPptr lp, double * objval_p )

int  CPXgetobjval( CPXCENVptr env, CPXCLPptr lp, double * objval_p )

Description

The routine CPXXgetobjval/CPXgetobjval accesses the solution objective value.

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.
objval_p
A pointer to a variable of type double where the objective value is stored.

Return

The routine returns 0 (zero) if successful and nonzero if no solution exists.

Example


status = CPXgetobjval (env, lp, &objval);

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