CPXXgetbase and CPXgetbase

The routine CPXXgetbase/CPXgetbase accesses the basis resident in a CPLEX problem object.

int  CPXXgetbase( CPXCENVptr env, CPXCLPptr lp, int * cstat, int * rstat )

int  CPXgetbase( CPXCENVptr env, CPXCLPptr lp, int * cstat, int * rstat )

Description

The routine CPXXgetbase/CPXgetbase accesses the basis resident in a CPLEX problem object. Either of the arguments cstat or rstat may be NULL if only one set of status values is needed.

Table 1. Table 1: Values of elements of cstat
CPX_AT_LOWER 0 variable at lower bound
CPX_BASIC 1 variable is basic
CPX_AT_UPPER 2 variable at upper bound
CPX_FREE_SUPER 3 variable free and nonbasic
Table 2. Table 2: Values of elements of rstat in rows other than ranged rows
CPX_AT_LOWER 0 associated slack, surplus, or artificial variable is nonbasic at value 0.0 (zero)
CPX_BASIC 1 associated slack, surplus, or artificial variable is basic
Table 3. Table 3: Values of elements of rstat for ranged rows
CPX_AT_LOWER 0 associated slack, surplus, or artificial variable is nonbasic at its lower bound
CPX_BASIC 1 associated slack, surplus, or artificial variable is basic
CPX_AT_UPPER 2 associated slack, surplus, or artificial variable is nonbasic at upper bound

Arguments

env
A pointer to the CPLEX environment as returned by CPXXopenCPLEX/CPXopenCPLEX.
lp
A pointer to a CPLEX problem object as returned by CPXXcreateprob/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 specified in Table 1.
rstat
An array to receive the basis status of the artificial, slack, or surplus variable associated with each row in the constraint matrix. The length of the array 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 specified in Table 2. For ranged rows, the array element rstat[i] has the meaning specified in Table 3.

Return

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

Example


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

See also the example lpex2.c in the examples distributed with the product.