The MOSEK Python optimizer API manual Version 7.0 (Revision 141)
Optimizer API for Python - Documentation - Mosek Optimizer API for Python - Documentation - Mosek
604 APPENDIX F. MOSEK FILE FORMATS F.2.2.4 MOSEK specific extensions to the LP format Some optimization software packages employ a more strict definition of the LP format that the one used by MOSEK. The limitations imposed by the strict LP format are the following: • Quadratic terms in the constraints are not allowed. • Names can be only 16 characters long. • Lines must not exceed 255 characters in length. If an LP formatted file created by MOSEK should satisfies the strict definition, then the parameter iparam.write lp strict format should be set; note, however, that some problems cannot be written correctly as a strict LP formatted file. For instance, all names are truncated to 16 characters and hence they may loose their uniqueness and change the problem. To get around some of the inconveniences converting from other problem formats, MOSEK allows lines to contain 1024 characters and names may have any length (shorter than the 1024 characters). Internally in MOSEK names may contain any (printable) character, many of which cannot be used in LP names. Setting the parameters iparam.read lp quoted names and iparam.write lp quoted names allows MOSEK to use quoted names. The first parameter tells MOSEK to remove quotes from quoted names e.g, "x1", when reading LP formatted files. The second parameter tells MOSEK to put quotes around any semi-illegal name (names beginning with a number or a period) and fully illegal name (containing illegal characters). As double quote is a legal character in the LP format, quoting semiillegal names makes them legal in the pure LP format as long as they are still shorter than 16 characters. Fully illegal names are still illegal in a pure LP file. F.2.3 The strict LP format The LP format is not a formal standard and different vendors have slightly different interpretations of the LP format. To make MOSEK’s definition of the LP format more compatible with the definitions of other vendors, use the parameter setting iparam.write lp strict format = onoffkey.on This setting may lead to truncation of some names and hence to an invalid LP file. The simple solution to this problem is to use the parameter setting
F.3. THE OPF FORMAT 605 iparam.write generic names = onoffkey.on which will cause all names to be renamed systematically in the output file. F.2.4 Formatting of an LP file A few parameters control the visual formatting of LP files written by MOSEK in order to make it easier to read the files. These parameters are iparam.write lp line width iparam.write lp terms per line The first parameter sets the maximum number of characters on a single line. The default value is 80 corresponding roughly to the width of a standard text document. The second parameter sets the maximum number of terms per line; a term means a sign, a coefficient, and a name (for example ”+ 42 elephants”). The default value is 0, meaning that there is no maximum. F.2.4.1 Speeding up file reading If the input file should be read as fast as possible using the least amount of memory, then it is important to tell MOSEK how many non-zeros, variables and constraints the problem contains. These values can be set using the parameters iparam.read con iparam.read var iparam.read anz iparam.read qnz F.2.4.2 Unnamed constraints Reading and writing an LP file with MOSEK may change it superficially. If an LP file contains unnamed constraints or objective these are given their generic names when the file is read (however unnamed constraints in MOSEK are written without names). F.3 The OPF format The Optimization Problem Format (OPF) is an alternative to LP and MPS files for specifying optimization problems. It is row-oriented, inspired by the CPLEX LP format.
- Page 575 and 576: D.5. PROGRESS CALL-BACK CODES 553 c
- Page 577 and 578: D.6. TYPES OF CONVEXITY CHECKS. 555
- Page 579 and 580: D.10. DOUBLE INFORMATION ITEMS 557
- Page 581 and 582: D.10. DOUBLE INFORMATION ITEMS 559
- Page 583 and 584: D.11. FEASIBILITY REPAIR TYPES 561
- Page 585 and 586: D.13. INTEGER INFORMATION ITEMS. 56
- Page 587 and 588: D.13. INTEGER INFORMATION ITEMS. 56
- Page 589 and 590: D.13. INTEGER INFORMATION ITEMS. 56
- Page 591 and 592: D.16. INPUT/OUTPUT MODES 569 intpnt
- Page 593 and 594: D.20. CONTINUOUS MIXED-INTEGER SOLU
- Page 595 and 596: D.26. OBJECTIVE SENSE TYPES 573 D.2
- Page 597 and 598: D.31. PRESOLVE METHOD. 575 paramete
- Page 599 and 600: D.35. RESPONSE CODE TYPE 577 D.35 R
- Page 601 and 602: D.42. PROBLEM REFORMULATION. 579 si
- Page 603 and 604: D.46. SOLUTION TYPES 581 solsta.dua
- Page 605 and 606: D.50. STREAM TYPES 583 startpointty
- Page 607 and 608: Appendix E Troubleshooting When cre
- Page 609 and 610: Appendix F Mosek file formats MOSEK
- Page 611 and 612: F.1. THE MPS FILE FORMAT 589 Fields
- Page 613 and 614: F.1. THE MPS FILE FORMAT 591 must b
- Page 615 and 616: F.1. THE MPS FILE FORMAT 593 Constr
- Page 617 and 618: F.1. THE MPS FILE FORMAT 595 v 1 is
- Page 619 and 620: F.1. THE MPS FILE FORMAT 597 Please
- Page 621 and 622: F.2. THE LP FILE FORMAT 599 minimiz
- Page 623 and 624: F.2. THE LP FILE FORMAT 601 st defi
- Page 625: F.2. THE LP FILE FORMAT 603 bounds
- Page 629 and 630: F.3. THE OPF FORMAT 607 [tag "value
- Page 631 and 632: F.3. THE OPF FORMAT 609 Note that a
- Page 633 and 634: F.3. THE OPF FORMAT 611 F.3.2.3 Nam
- Page 635 and 636: F.3. THE OPF FORMAT 613 [bounds] [b
- Page 637 and 638: F.4. THE TASK FORMAT 615 This can b
- Page 639 and 640: F.7. THE SOLUTION FILE FORMAT 617 c
- Page 641 and 642: Appendix G Problem analyzer example
- Page 643 and 644: G.2. ARKI001 621 2 476 45.42 48.19
- Page 645 and 646: G.4. PROBLEM WITH BOTH LINEAR AND C
- Page 647 and 648: Bibliography [1] Chvátal, V.. Line
- Page 649 and 650: Index analyzenames (Task method), 2
- Page 651 and 652: INDEX 629 getpcni (Task method), 25
- Page 653 and 654: INDEX 631 putbarablocktriplet (Task
- Page 655 and 656: INDEX 633 rescode.err inv numj, 521
- Page 657 and 658: INDEX 635 rescode.err sen bound inv
604 APPENDIX F. <strong>MOSEK</strong> FILE FORMATS<br />
F.2.2.4<br />
<strong>MOSEK</strong> specific extensions to the LP format<br />
Some optimization software packages employ a more strict definition of the LP format that the one<br />
used by <strong>MOSEK</strong>. <strong>The</strong> limitations imposed by the strict LP format are the following:<br />
• Quadratic terms in the constraints are not allowed.<br />
• Names can be only 16 characters long.<br />
• Lines must not exceed 255 characters in length.<br />
If an LP formatted file created by <strong>MOSEK</strong> should satisfies the strict definition, then the parameter<br />
iparam.write lp strict format<br />
should be set; note, however, that some problems cannot be written correctly as a strict LP formatted<br />
file. For instance, all names are truncated to 16 characters and hence they may loose their uniqueness<br />
and change the problem.<br />
To get around some of the inconveniences converting from other problem formats, <strong>MOSEK</strong> allows lines<br />
to contain 1024 characters and names may have any length (shorter than the 1024 characters).<br />
Internally in <strong>MOSEK</strong> names may contain any (printable) character, many of which cannot be used in<br />
LP names. Setting the parameters<br />
iparam.read lp quoted names<br />
and<br />
iparam.write lp quoted names<br />
allows <strong>MOSEK</strong> to use quoted names. <strong>The</strong> first parameter tells <strong>MOSEK</strong> to remove quotes from quoted<br />
names e.g, "x1", when reading LP formatted files. <strong>The</strong> second parameter tells <strong>MOSEK</strong> to put quotes<br />
around any semi-illegal name (names beginning with a number or a period) and fully illegal name<br />
(containing illegal characters). As double quote is a legal character in the LP format, quoting semiillegal<br />
names makes them legal in the pure LP format as long as they are still shorter than 16 characters.<br />
Fully illegal names are still illegal in a pure LP file.<br />
F.2.3<br />
<strong>The</strong> strict LP format<br />
<strong>The</strong> LP format is not a formal standard and different vendors have slightly different interpretations of<br />
the LP format. To make <strong>MOSEK</strong>’s definition of the LP format more compatible with the definitions<br />
of other vendors, use the parameter setting<br />
iparam.write lp strict format = onoffkey.on<br />
This setting may lead to truncation of some names and hence to an invalid LP file. <strong>The</strong> simple solution<br />
to this problem is to use the parameter setting