CPXgetbase


Description

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.

Return Value

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

Synopsis

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

Arguments

CPXCENVptr env

The pointer to the CPLEX environment as returned by CPXopenCPLEX().

CPXCLPptr lp

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

int *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.

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 CPLEX 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/surplus/artificial variable non-basic at its lower bound 
CPX_BASIC 
1 
associated slack/surplus/artificial variable basic 
CPX_AT_UPPER 
2 
associated slack/surplus/artificial 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: CPXgetbaritcnt Return to Top Next Page: CPXgetbestobjval