Previous Page: CPXdualoptFirst PageNext Page: CPXembwrite

CPXdualwrite


Description

The routine CPXdualwrite() is used to write a dual formulation of the current LP problem object. MPS format is used. This function can be applied only to a linear program; it will generate an error for other problem types.

Any fixed variables in the primal will be removed before the dual problem is written to a file. Each fixed variable with a nonzero objective coefficient will cause the objective value to shift. As a result, the optimal objective obtained from solving the dual problem created using CPXdualwrite() may not be the same as the optimal objective of the primal problem if fixed variables are present. The objshift_p parameter can be used to reconcile this difference.
Invoking CPXdualwrite() writes the dual problem formulation to a file, but does not remove the problem object or free any memory allocated to the current problem. These tasks must be carried out separately.

Return Value

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

Synopsis

int CPXdualwrite (CPXENVptr env,
                  CPXLPptr lp,
                  char *filename,
                  double *objshift_p);

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

char *filename
A character string containing the name of the file to which the dual problem should be written.

double *objshift_p
A pointer to a variable of type double to hold the change in the objective function resulting from the removal of fixed variables in the primal.

Example

status = CPXdualwrite (env, lp, "myfile.dua", &objshift);

Previous Page: CPXdualoptFirst PageNext Page: CPXembwrite