NO FRAMES

CPXwriteprob

public int CPXwriteprob(CPXCENVptr env, CPXCLPptr lp, const char * filename_str, const char * filetype_str)
Definition file: cplex.h

The routine CPXwriteprob writes a CPLEX problem object to a file in one of the formats in the table. These formats are documented in the reference manual ILOG CPLEX File Formats and examples of their use appear in the ILOG CPLEX User's Manual.

File formats
SAVBinary matrix and basis file
MPSMPS format
LPCPLEX LP format with names modified to conform to LP format
REWMPS format, with all names changed to generic names
RMPMPS format, with all names changed to generic names
RLPLP format, with all names changed to generic names

When this routine is invoked, the current problem is written to a file. If the file name ends with one of the following extensions, a compressed file is written.

Microsoft Windows does not support writing compressed files with this API.

Example

 status = CPXwriteprob (env, lp, "myprob.sav", NULL);
 

See also the example lpex1.c in the ILOG CPLEX User's Manual and in the standard distribution.

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 problem is to be written, unless otherwise specified with the filetype argument. If the file name ends with .gz or .bz2, a compressed file is written in accordance with the selected file type.

filetype_str

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

Returns:

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