Previous Page: CPXNETcopybase First PageNext Page: CPXNETcreateprob

CPXNETcopynet


Description

This function copies a network to a network object, overriding any other network that may be saved in the object. The network to be copied is specified by providing the:

The arcs are numbered according to the order given in the fromnode and tonode arrays. Some of the parameters are optional and replaced by default values if NULL is passed for them.

Return Value

If the operation is successful, CPXNETcopynet() returns the value 0; if not, it returns a nonzero value to indicate an error.

Synopsis

int CPXNETcopynet (CPXENVptr env,
                   CPXNETptr net,
                   int objsen,
                   int nnodes,
                   double *supply,
                   char **nnames,
                   int narcs,
                   int *fromnode,
                   int *tonode,
                   double *low,
                   double *up,
                   double *obj,
                   char **anames);

Arguments


CPXENVptr env
The pointer to the CPLEX environment as returned by one of the CPXopenCPLEX routines.

CPXNETptr net
A pointer to a CPLEX network problem object as returned by CPXNETcreateprob().

int objsen
Optimization sense of the network to be copied. It may take values CPX_MAX for a maximization problem or CPX_MIN for a minimization problem.

int nnodes
Number of nodes to be copied from the network.

double *supply
Supply values for the nodes. If NULL is passed all supply values will default to 0. Otherwise the size of the array must be at least nnodes.

char **nnames
Pointer to an array of names for the nodes. If NULL is passed, no names are assigned to the nodes. Otherwise the size of the array must be at least nnodes and every name in the array must be a string terminating in 0.

int narcs
Number of arcs to be copied from the network.

int *fromnode
The array of indices in each arc's "from node". The indices must be in the range[0, nnodes-1]. The size of the array must be at least narcs.

int *tonode
The array of indices in each arc's "to node". The indices must be in the range[0, nnodes-1]. The size of the array must be at least narcs.

double *low
Pointer to an array of lower bounds on the flow through arcs. If NULL is passed, all lower bounds default to 0. Otherwise the size of the array must be at least narcs. Values lower than or equal to -CPX_INFBOUND are considered -infinity.

double *up
Pointer to an array of upper bounds on the flow through arcs. If NULL is passed, all lower 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 infinity.

double *obj
Pointer to an array of objective values for flow through arcs. If NULL is passed, all objective values default to 0. Otherwise the size of the array must be at least narcs.

char **anames
Pointer to an array of names for the arcs. If NULL is passed, no names are assigned to the nodes. Otherwise the size of the array must be at least narcs, and every name in the array must be a string terminating in 0.

Example

status = CPXNETcopynet (env, net, CPX_MAX, nnodes, supply, NULL,
                        narcs, fromnode, tonode, NULL, NULL, obj,
                        NULL);
Previous Page: CPXNETcopybase First PageNext Page: CPXNETcreateprob