Previous Page: CPXcloseCPLEXFirst PageNext Page: CPXcopyctype

CPXcopybase


Description

The routine CPXcopybase() is used to copy a basis into an LP problem object. It is not necessary to copy a basis prior to optimizing an LP problem, but a good initial basis can increase the speed of optimization significantly. A basis does not need to be primal or dual feasible to be used by the optimizer. Note that the basis is ignored by the solver if the CPX_PARAM_ADVIND is set to CPX_OFF.

Return Value

The routine returns a zero on success, and a nonzero if an error occurs.

Synopsis

int CPXcopybase (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 containing the basis status of the columns in the constraint matrix. The length of the array is equal to the number of columns in the LP problem object.

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 containing the basis status of the slack/surplus/artificial variable associated with each row in the constraint matrix. The array's length is equal to 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 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 its upper bound  

Example

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

See Also

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

CPXreadcopybase()

Previous Page: CPXcloseCPLEXFirst PageNext Page: CPXcopyctype