NO FRAMES

CPXwritesol

int CPXPUBLIC CPXwritesol(CPXCENVptr env, CPXCLPptr lp, const char * filename_str, const char * filetype_str)
Definition file: cplex.h
Include files: cplex.h

The routine CPXwritesol is used to write a solution file for the selected CPLEX problem object. The routine can write files in:

The ASCII and binary formats are documented in the reference manual ILOG CPLEX File Formats and examples of their use appear in the ILOG CPLEX User's Manual.

Values of filetype_str
'TXT'ASCII solution file
'BIN'Binary solution file

Example

 status = CPXwritesol (env, lp, "myfile.txt", NULL);

Parameters:

env

A pointer to the CPLEX environment as returned by CPXopenCPLEX.

lp

A pointer to a CPLEX problem object as returned by CPXcreateprob.

filename_str

A character string containing the name of the file to which the solution should be written.

filetype_str

A character string containing the type of the file. The type of the file can be one of the values in the table. May be NULL, in which case the type is inferred from the characters following the last period in the filename. The string is not case sensitive.

Returns:

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