Overview | Group | Tree | Graph | Index | Concepts |
The routine CPXreadcopyprob
reads an MPS
,
LP
or SAV
file into an existing CPLEX problem
object. Any existing data associated with the problem object is destroyed.
The problem can then be optimized via any one of the optimization routines.
To determine the contents of the data, CPLEX query routines can be used.
The type of the file may be specified with the filetype
argument. When the filetype
argument is NULL, the end of the
file name is checked for one of the strings .lp
,
.lp.gz
, .lp.z
, .mps
,
mps.gz
, .mps.z
, .sav
,
.sav.gz
, or .sav.z
.
If one of these strings is present, filetype
is set
accordingly. If filetype
is NULL and none of these strings is
at the end of the file name, the routine automatically detects the type of
the file by examining the first few bytes of the file.
If the file name ends in .gz
or .z
the file is read as a compressed file. Thus, a file name ending
in .sav
is read as a SAV
format file,
while a file name ending in .sav.gz
is read as a
compressed SAV
format file.
If the file name does not end with a recognized type, CPLEX attempts to auto-detect the file type.
"SAV" | Use SAV format |
"MPS" | Use MPS format |
"LP" | Use LP format |
Example
status = CPXreadcopyprob (env, lp, "myprob.mps", NULL);
See also the example lpex2.c
in the
ILOG CPLEX User's Manual and in the standard distribution.
env | A pointer to the CPLEX environment as returned by |
lp | A pointer to a CPLEX problem object as returned by |
filename_str | The name of the file from which the problem should be read. |
filetype_str | A case insensitive string containing the type of the file, one of the strings in the table. May be NULL, in which case the file type is inferred from the last characters of the file name. |