The MOSEK command line tool Version 7.0 (Revision 141)

The MOSEK command line tool. Version 7.0 ... - Documentation The MOSEK command line tool. Version 7.0 ... - Documentation

25.11.2015 Views

294 CHAPTER 14. THE LP FILE FORMAT The algorithm for making names LP valid works as follows: The name is interpreted as an utf-8 string. For a unicode character c: • If c==‘ ’ (underscore), the output is ‘ ’ (two underscores). • If c is a valid LP name character, the output is just c. • If c is another character in the ASCII range, the output is XX, where XX is the hexadecimal code for the character. • If c is a character in the range 127—65535, the output is uXXXX, where XXXX is the hexadecimal code for the character. • If c is a character above 65535, the output is UXXXXXXXX, where XXXXXXXX is the hexadecimal code for the character. Invalid utf-8 substrings are escaped as ‘ XX’, and if a name starts with a period, ‘e’ or ‘E’, that character is escaped as ‘ XX’. 14.2.3 Variable bounds Specifying several upper or lower bounds on one variable is possible but MOSEK uses only the tightest bounds. If a variable is fixed (with =), then it is considered the tightest bound. 14.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 MSK IPAR 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

14.3. THE STRICT LP FORMAT 295 MSK IPAR READ LP QUOTED NAMES and MSK IPAR 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. 14.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 MSK IPAR WRITE LP STRICT FORMAT = MSK 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 MSK IPAR WRITE GENERIC NAMES = MSK ON which will cause all names to be renamed systematically in the output file. 14.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 MSK IPAR WRITE LP LINE WIDTH MSK IPAR 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.

294 CHAPTER 14. THE LP FILE FORMAT<br />

<strong>The</strong> algorithm for making names LP valid works as follows: <strong>The</strong> name is interpreted as an utf-8<br />

string. For a unicode character c:<br />

• If c==‘ ’ (underscore), the output is ‘<br />

’ (two underscores).<br />

• If c is a valid LP name character, the output is just c.<br />

• If c is another character in the ASCII range, the output is XX, where XX is the hexadecimal code<br />

for the character.<br />

• If c is a character in the range 127—65535, the output is uXXXX, where XXXX is the hexadecimal<br />

code for the character.<br />

• If c is a character above 65535, the output is UXXXXXXXX, where XXXXXXXX is the hexadecimal<br />

code for the character.<br />

Invalid utf-8 substrings are escaped as ‘ XX’, and if a name starts with a period, ‘e’ or ‘E’, that<br />

character is escaped as ‘ XX’.<br />

14.2.3 Variable bounds<br />

Specifying several upper or lower bounds on one variable is possible but <strong>MOSEK</strong> uses only the tightest<br />

bounds. If a variable is fixed (with =), then it is considered the tightest bound.<br />

14.2.4 <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 />

MSK IPAR 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 <strong>line</strong>s<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

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!