CPXXsolwritesolnpool and CPXsolwritesolnpool

The routine CPXXsolwritesolnpool/CPXsolwritesolnpool writes a solution file, using either the incumbent solution or a solution from the solution pool, for the selected CPLEX problem object.

int  CPXXsolwritesolnpool( CPXCENVptr env, CPXCLPptr lp, int soln, char const * filename_str )

int  CPXsolwritesolnpool( CPXCENVptr env, CPXCLPptr lp, int soln, char const * filename_str )

Description

The routine CPXXsolwritesolnpool/CPXsolwritesolnpool writes a solution file, using either the incumbent solution or a solution from the solution pool, for the selected CPLEX problem object. The routine writes files in SOL format, which is an XML format.

The SOL format is documented in the stylesheet solution.xsl and schema solution.xsd in the include directory of the CPLEX distribution. CPLEX File Formats Reference Manual also documents this format briefly.

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.
soln
An integer specifying the index of the solution pool member which should be written. A value of -1 specifies that the incumbent solution should be used instead of a solution pool member.
filename_str
A character string containing the name of the file to which the solution should be written.

Return

The routine returns 0 (zero) if successful and nonzero if an error occurs.

Example


status = CPXsolwritesolnpool (env, lp, 1, "myfile.sol");