CPXXNETgetobjval and CPXNETgetobjval
The routine CPXXNETgetobjval/CPXNETgetobjval returns the objective value of
the solution stored in a network problem object.
int CPXXNETgetobjval( CPXCENVptr env, CPXCNETptr net, double * objval_p )
int CPXNETgetobjval( CPXCENVptr env, CPXCNETptr net, double * objval_p )
Description
The routine CPXXNETgetobjval/CPXNETgetobjval returns the objective value of
the solution stored in a network problem object.
If the current solution is not feasible, the value returned depends on
the setting of the
network logging display switch (CPXPARAM_Network_Display parameter). If this
parameter is set to CPXNET_PENALIZED_OBJECTIVE(2), an
objective function value is reported that includes penalty contributions for
arcs on which the flow at termination violated the flow bounds on that arc.
Arguments
- env
-
A pointer to the CPLEX environment as returned by
CPXXopenCPLEX/CPXopenCPLEX. - net
-
A pointer to a CPLEX network problem object as returned by
CPXXNETcreateprob/CPXNETcreateprob. - objval_p
- Pointer to where the objective value is written. If NULL is passed, no objective value is returned.
Return
The routine returns 0 (zero) on success and nonzero if an error occurs.Example
status = CPXNETgetobjval (env, net, &objval);