CPXXNETaddarcs and CPXNETaddarcs

The routine CPXXNETaddarcs/CPXNETaddarcs adds new arcs to the network stored in a network problem object.

int  CPXXNETaddarcs( CPXCENVptr env, CPXNETptr net, CPXDIM narcs, CPXDIM const * fromnode, CPXDIM const * tonode, double const * low, double const * up, double const * obj, char const *const * anames )

int  CPXNETaddarcs( CPXCENVptr env, CPXNETptr net, int narcs, int const * fromnode, int const * tonode, double const * low, double const * up, double const * obj, char ** anames )

Description

The routine CPXXNETaddarcs/CPXNETaddarcs adds new arcs to the network stored in a network problem object.

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.
narcs
Number of arcs to be added.
fromnode
Array of indices of the from-node for the arcs to be added. All the indices must be greater than or equal to 0. If a node index is greater than or equal to the number of nodes currently in the network (see CPXXNETgetnumnodes/CPXNETgetnumnodes) new nodes are created implicitly with default supply values 0. The size of the fromnode array must be at least narcs.
tonode
Array of indices of the to-node for the arcs to be added. All the indices must be greater than or equal to 0. If a node index is greater than or equal to the number of nodes currently in the network (see CPXXNETgetnumnodes/CPXNETgetnumnodes) new nodes are created implicitly with default supply values 0. The size of the tonode array must be at least narcs.
low
Pointer to an array of lower bounds on the flow through added arcs. If NULL is passed, all lower bounds default to 0 (zero). Otherwise, the size of the array must be at least narcs. Values less than or equal to -CPX_INFBOUND are considered as negative infinity.
up
Pointer to an array of upper bounds on the flow of added arcs. If NULL is passed, all upper bounds default to CPX_INFBOUND. Otherwise, the size of the array must be at least narcs. Values greater than or equal to CPX_INFBOUND are considered as infinity.
obj
Pointer to an array of objective values for the added arcs. If NULL is passed, all objective values default to 0. Otherwise, the size of the array must be at least narcs.
anames
Pointer to an array of names for added arcs. If NULL is passed and the existing arcs have names, default names are assigned to the added arcs. If NULL is passed and the existing arcs have no names, the new arcs are assigned no names. Otherwise, the size of the array must be at least narcs and every name in the array must be a string terminating in 0. If the existing arcs have no names and anames is not NULL, default names are assigned to the existing arcs.

Return

The routine returns 0 (zero) on success and nonzero if an error occurs.

Example


 status = CPXNETaddarcs (env, net, narcs, fromnode, tonode, NULL,
                         NULL, obj, NULL);