Previous Page: CPXgetaxFirst PageNext Page: CPXgetbestobjval

CPXgetbase


Description

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

Return Value

If a basis exists, CPXgetbase() returns the value zero; if not, or if some other error occurs, it returns a nonzero value.

Synopsis

int CPXgetbase (CPXENVptr env,
               CPXLPptr lp,
               int *cstat,
               int *rstat);

Arguments


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

CPXLPptr lp
A pointer to a CPLEX LP problem object as returned by CPXcreateprob().

int *cstat
An array to receive the basis status of the columns in the LP problem object. The length of the array must be no less than the number of columns in the matrix.

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 non-basic  

Values for cstat[j]:

int *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 LP problem object. For rows other than ranged rows, the array element rstat[i] has the following meaning:

CPX_AT_LOWER  
0  
associated slack/surplus/artificial variable non-basic at value 0.0  
CPX_BASIC  
1  
associated slack/surplus/artificial variable basic  

For ranged rows, the array element rstat[i] has the following meaning:

CPX_AT_LOWER  
0  
associated slack variable non-basic at its lower bound  
CPX_BASIC  
1  
associated slack variable basic  
CPX_AT_UPPER  
2  
associated slack variable non-basic at upper bound  

Example

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

See Also

Example lpex2.c in the CPLEX User's Manual.

Previous Page: CPXgetaxFirst PageNext Page: CPXgetbestobjval