NO FRAMES

CPXNETsolution

int CPXPUBLIC CPXNETsolution(CPXCENVptr env, CPXCNETptr net, int * netstat_p, double * objval_p, double * x, double * pi, double * slack, double * dj)
Definition file: cplex.h
Include files: cplex.h

The routine CPXNETsolution accesses solution values for a network problem object computed by a previous call to 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 CPXNETsolninfo.

The arguments to 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 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 CPXNETsolution is not required, a NULL pointer can be passed for that argument.

Example

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

Parameters:

env

A pointer to the CPLEX environment as returned by CPXopenCPLEX.

net

A pointer to a CPLEX network problem object as returned by 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 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 parameter CPX_PARAM_NETDISPLAY. 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 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 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 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 CPXNETgetnumarcs.

Returns:

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