NO FRAMES

CPXpivot

int CPXPUBLIC CPXpivot(CPXCENVptr env, CPXLPptr lp, int jenter, int jleave, int leavestat)
Definition file: cplex.h
Include files: cplex.h
Note

This is an advanced routine. Advanced routines typically demand a profound understanding of the algorithms used by ILOG CPLEX. Thus they incur a higher risk of incorrect behavior in your application, behavior that can be difficult to debug. Therefore, ILOG encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead.

The routine CPXpivot performs a basis change where variable jenter replaces variable jleave in the basis.

Use the constant CPX_NO_VARIABLE for jenter or for jleave if you want ILOG CPLEX to determine one of the two variables involved in the basis change.

It is invalid to pass a basic variable for jenter. Also, no nonbasic variable may be specified for jleave, except for jenter == jleave when the variable has both finite upper and lower bounds. In that case the variable is moved from the current to the other bound. No shifting or perturbation is performed.

Example

 status = CPXpivot (env, lp, jenter, jleave, CPX_AT_LOWER);
 

Parameters:

env

A pointer to the CPLEX environment, as returned by the CPXopenCPLEX.

lp

A pointer to a CPLEX LP problem object, as returned by CPXcreateprob.

jenter

An index indicating the variable to enter the basis. The slack or artificial variable for row i is denoted by jenter = -i-1. The argument jenter must either identify a nonbasic variable or take the value CPX_NO_VARIABLE. When jenter is set to CPX_NO_VARIABLE, ILOG CPLEX will use the leaving variable jleave to perform a dual simplex method ratio test that determines the entering variable.

jleave

An index indicating the variable to leave the basis. The slack or artificial variable for row i is denoted by jenter = -i-1. The argument jleave typically identifies a basic variable. However, if jenter denotes a variable with finite upper and lower bounds, jleave may be set to jenter to indicate that the variable moves from its current bound to the other. The argument jleave may also be set to CPX_NO_VARIABLE. In that case, ILOG CPLEX will use the incoming variable jenter to perform a primal simplex method ratio test that determines the leaving variable.

leavestat

An integer indicating the nonbasic status to be assigned to the leaving variable after the basis change. This is important for the case where jleave indicates a variable with finite upper and lower bounds, as it may become nonbasic at its lower or upper bound.

Example

 status = CPXpivot (env, lp, jenter, jleave, CPX_AT_LOWER);
 

Returns:

This routine returns zero on success and nonzero if an error occurs.