NO FRAMES

CPXgetbase

int CPXPUBLIC CPXgetbase(CPXCENVptr env, CPXCLPptr lp, int * cstat, int * rstat)
Definition file: cplex.h
Include files: cplex.h

The routine CPXgetbase is used to get the basis resident in a CPLEX problem object. Either of the arguments cstat or rstat may be NULL, if only one set of statuses is needed.

Table 1: Values of elements of cstat
CPX_AT_LOWER0variable at lower bound
CPX_BASIC1variable is basic
CPX_AT_UPPER2variable at upper bound
CPX_FREE_SUPER3variable free and nonbasic
Table 2: Values of elements of rstat in rows other than ranged rows
CPX_AT_LOWER0associated slack/surplus/artificial variable nonbasic at value 0.0
CPX_BASIC1 associated slack/surplus/artificial variable basic
Table 3: Values of elements of rstat for ranged rows
CPX_AT_LOWER0associated slack/surplus/artificial variable nonbasic at its lower bound
CPX_BASIC1associated slack/surplus/artificial variable basic
CPX_AT_UPPER2associated slack/surplus/artificial variable nonbasic at upper bound

Example

 status = CPXgetbase (env, lp, cstat, rstat);

See also the example lpex6.c in the ILOG CPLEX User's Manual and in the standard distribution.

Parameters:

env

A pointer to the CPLEX environment as returned by CPXopenCPLEX.

lp

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

cstat

An array to receive the basis status of the columns in the CPLEX problem object. The length of the array must be no less than the number of columns in the matrix. The array element cstat[i] has the meaning indicated in Table 1.

rstat

An array to receive the basis status of the artificial/slack/surplus variable associated with each row in the constraint matrix. The array's length must be no less than the number of rows in the CPLEX problem object. For rows other than ranged rows, the array element rstat[i] has the meaning indicated in Table 2. For ranged rows, the array element rstat[i] has the meaning indicated in Table 3.

Returns:

The routine returns zero if a basis exists. It returns zero if no solution exists or any other type of error occurs.