exportprob
exportprob |
Purpose
Synopsis
procedure exportprob(options:integer, filename:string, obj:linctr)
procedure exportprob(options:integer, filename:string)
procedure exportprob(filename:string, obj:linctr)
procedure exportprob(filename:string)
procedure exportprob
Arguments
options
|
File format options:
Several options may be combined using
+.
|
||||||||
filename
|
Name of the output file. If the empty string
"" is given, output is printed to the standard output (the screen)
|
||||||||
obj
|
Objective function constraint
|
Example
The following prints the current problem to the screen using the default format and with
MinCost as objective function. The second statement exports the problem in LP-format and with scrambled names to the file
prob1.lp maximizing the constraint
Profit:
declarations MinCost, Profit:linctr end-declarations exportprob(0, "", MinCost) exportprob(EP_MAX+EP_STRIP, "prob1", Profit)
Further information
1. If the given filename uses the default IO driver (no driver specified) and has no extension, Mosel appends
.lp to it for LP format files and
.mps for MPS format.
2. Normally, local symbols (
i.e. defined in a procedure or function) are replaced by generated names in the exported matrix. However, if the model has been compiled with option
-G, names defined locally to the routine calling
exportprob are used in the exported matrix. Moreover, if a local symbol hides a global one, this symbol is prefixed by '˜'.
3. If the model is compiled with
-G and the control parameter
recloc is set to
true (see
setparam), missing constraint names are replaced by the source location of the constraint definition (
i.e. a combination of the row number, source file name and line number in the file).
4. If no option is provided, the default format is LP for a minimization; if no constraint is given, the current objective (if available) is exported. The matrix is printed to the standard output when this function is used without parameter.
5. This function exports only the LP/MIP problem directly handled by the Mosel core libraries. It cannot report problem extensions managed by external modules. For instance, quadratic constraints or indicator constraints provided by the Xpress Optimizer are not shown by this routine: for this type of problems, the module-specific
writeprob routine has to be used instead of
exportprob.
Related topics