Previous Page: CPXcopysosFirst PageNext Page: CPXcreateprob

CPXcopystart


Description

The CPXcopystart() routine is used to copy starting-point information. Any one of three different kinds of starting points can be copied, in any combination: a starting basis (cstat, rstat), starting primal values (cprim, rprim), and starting dual values (cdual, rdual).

In order for at least one of the three pairs to be successfully used, both members of some pair must be specified. Thus, both of cstat and rstat, both of cprim and rprim, or both of cdual and rdual must be specified. If there is no such pair of pointers (both of which are not NULL), an error is returned; otherwise, any resident starting-point information is freed and the specified new information is copied.

After a call to CPXcopystart(), the CPLEX routines CPXprimopt(), CPXdualopt(), and CPXhybbaropt() will use this information to construct a starting point for the CPLEX simplex algorithms or the CPLEX crossover algorithms.

The starting point information is ignored by the optimizers if the CPX_PARAM_ADVIND parameter is off.

Return Value

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

Synopsis

int CPXcopystart (CPXENVptr env,
                  CPXLPptr lp,
                  int *cstat,
                  int *rstat,
                  double *cprim,
                  double *rprim,
                  double *cdual,
                  double *rdual);

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]:

If this array is NULL, rstat must be NULL.

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

If this array is NULL, cstat must be NULL.

double *cprim
An array containing the initial values of the primal column variables. The length of the array must be no less than the number of columns in the LP problem object. If this array is NULL, rprim must be NULL.

double *rprim
An array containing the initial values of the primal slack (row) variables. The length of the array must be no less than the number of rows in the LP problem object. If this array is NULL, cprim must be NULL.

double *cdual
An array containing the initial values of the reduced costs for the column variables. The length of the array must be no less than the number of columns in the LP problem object. If this array is NULL, rdual must be NULL.

double *rdual
An array containing the initial values of the dual variables for the rows.The length of the array must be no less than the number of rows in the LP problem object. If this array is NULL, cdual must be NULL.

Example

status = CPXcopystart (env, lp, cstat, rstat, cprim, rprim,
                       cdual, rdual);
Previous Page: CPXcopysosFirst PageNext Page: CPXcreateprob