CPXXNETgetnodearcs and CPXNETgetnodearcs

The routine CPXXNETgetnodearcs/CPXNETgetnodearcs is used to access the arc indices incident to a range of nodes in the network stored in a network problem object.

int  CPXXNETgetnodearcs( CPXCENVptr env, CPXCNETptr net, CPXDIM * arccnt_p, CPXDIM * arcbeg, CPXDIM * arc, CPXDIM arcspace, CPXDIM * surplus_p, CPXDIM begin, CPXDIM end )

int  CPXNETgetnodearcs( CPXCENVptr env, CPXCNETptr net, int * arccnt_p, int * arcbeg, int * arc, int arcspace, int * surplus_p, int begin, int end )

Description

The routine CPXXNETgetnodearcs/CPXNETgetnodearcs is used to access the arc indices incident to a range of nodes in 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.

arccnt_p

A pointer to an integer to contain the total number of arc indices returned in the array arc.

arcbeg

An array that contain indices indicating where each of the requested arc lists start in array arc. Specifically, the list of arcs incident to node i (< end) consists of the entries in arc in the range from arcbeg[i-begin] to arcbeg[(i+1)-begin]-1. The list of arcs incident to node end consists of the entries in arc in the range from arcbeg[end-begin] to *arccnt_p-1. This array must have a length of at least end-begin+1.

arc

An array that contain the arc indices for the arcs incident to the nodes in the specified range. May be NULL if arcspace is zero.

arcspace

An integer indicating the length of the array arc. May be zero.

surplus_p

A pointer to an integer to contain the difference between arcspace and the number of arcs incident to the nodes in the specified range. A nonnegative value specifies that arcspace was sufficient. A negative value specifies that it was insufficient and that the routine could not complete its task. In that case, CPXERR_NEGATIVE_SURPLUS is returned and the negative value of surplus_p specifies the amount of insufficient space in the array arc.

begin

Index of the first node for which arcs are to be obtained.

end

Index of the last node for which arcs are to be obtained.

Return

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

Example


 status = CPXNETgetnodearcs (env, net, &arccnt, arcbeg, arc,
                             arcspace, &surplus, begin, end);