CPXXdualwrite and CPXdualwrite
The routine CPXXdualwrite/CPXdualwrite writes a dual
formulation of the current CPLEX problem object.
int CPXXdualwrite( CPXCENVptr env, CPXCLPptr lp, char const * filename_str, double * objshift_p )
int CPXdualwrite( CPXCENVptr env, CPXCLPptr lp, char const * filename_str, double * objshift_p )
Description
The routine CPXXdualwrite/CPXdualwrite writes a dual
formulation of the current CPLEX problem object. MPS format is used. This
function can only be applied to a linear program; it generates an error for
other problem types.
Note:
Any fixed variables in the primal are removed before the dual problem is
written to a file. Each fixed variable with a nonzero objective coefficient
causes the objective value to shift. As a result, if fixed variables are
present, the optimal objective obtained from solving the dual problem
created using
CPXXdualwrite/CPXdualwrite may not be the same as the optimal
objective of the primal problem. The argument objshift_p can
be used to reconcile this difference.Arguments
- env
-
A pointer to the CPLEX environment as returned by
CPXXopenCPLEX/CPXopenCPLEX. - lp
-
A pointer to a CPLEX problem object as returned by
CPXXcreateprob/CPXcreateprob. - filename_str
- A character string containing the name of the file to which the dual problem should be written.
- objshift_p
-
A pointer to a variable of type
doubleto hold the change in the objective function resulting from the removal of fixed variables in the primal.
Return
The routine returns 0 (zero) if successful and nonzero if an error occurs.Example
status = CPXdualwrite (env, lp, "myfile.dua", &objshift);