CPXXNETsolution and CPXNETsolution

The routine CPXXNETsolution/CPXNETsolution accesses solution values for a network problem object computed by the most recent call to CPXXNETprimopt/CPXNETprimopt for that object.

int  CPXXNETsolution( CPXCENVptr env, CPXCNETptr net, int * netstat_p, double * objval_p, double * x, double * pi, double * slack, double * dj )

int  CPXNETsolution( CPXCENVptr env, CPXCNETptr net, int * netstat_p, double * objval_p, double * x, double * pi, double * slack, double * dj )

Description

The routine CPXXNETsolution/CPXNETsolution accesses solution values for a network problem object computed by the most recent call to CPXXNETprimopt/CPXNETprimopt for that object. The solution values are maintained in the object as long as no changes are applied to it with one of the CPXNETchg..., CPXNETcopy... or CPXNETadd...functions. Whether or not a solution exists can be determined by CPXXNETsolninfo/CPXNETsolninfo.

The arguments to CPXXNETsolution/CPXNETsolution are pointers to locations where data is to be written. Such data includes the solution status, the value of the objective function, primal, dual and slack values and the reduced costs.

Although all the above data exists after a successful call to CPXXNETprimopt/CPXNETprimopt, it is possible that the user only needs a subset of the available data. Thus, if any part of the solution represented by an argument to CPXXNETsolution/CPXNETsolution is not required, a NULL pointer can be passed for that argument.

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.
netstat_p
Pointer to which the solution status is to be written. The specific values that *netstat_p can take and their meanings are the same as the return values documented for CPXXNETgetstat/CPXNETgetstat.
objval_p
Pointer to which the objective value is to be written. If NULL is passed, no objective value is returned. If the solution status is one of the CPX_STAT_ABORT codes, the value returned depends on the setting of the network logging display switch (CPXPARAM_Network_Display parameter). If this parameter is set to 2, objective function values that are penalized for infeasible flows are used to compute the objective value of the solution. Otherwise, the true objective function values are used.
x
Array to which the solution (flow) vector is to be written. If NULL is passed, no solution vector is returned. Otherwise, x must point to an array of size at least that returned by CPXXNETgetnumarcs/CPXNETgetnumarcs.
pi
Array to which the dual values are to be written. If NULL is passed, no dual values are returned. Otherwise, pi must point to an array of size at least that returned by CPXXNETgetnumnodes/CPXNETgetnumnodes.
slack
Array to which the slack values (violations of supplies/demands) are to be written. If NULL is passed, no slack values are returned. Otherwise, slack must point to an array of size at least that returned by CPXXNETgetnumnodes/CPXNETgetnumnodes.
dj
Array to which the reduced cost values are to be written. If NULL is passed, no reduced cost values are returned. Otherwise, dj must point to an array of size at least that returned by CPXXNETgetnumarcs/CPXNETgetnumarcs.

Return

If a solution exists, it returns 0 (zero); if not, it returns nonzero to indicate an error.

Example


 status = CPXNETsolution (env, net, &netstatus, &objval, x, pi,
                          slack, dj);