25.11.2015 Views

The MOSEK Python optimizer API manual Version 7.0 (Revision 141)

Optimizer API for Python - Documentation - Mosek

Optimizer API for Python - Documentation - Mosek

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

F.3. THE OPF FORMAT 611<br />

F.3.2.3<br />

Names<br />

Variable names, constraint names and objective name may contain arbitrary characters, which in some<br />

cases must be enclosed by quotes (single or double) that in turn must be preceded by a backslash.<br />

Unquoted names must begin with a letter (a-z or A-Z) and contain only the following characters: the<br />

letters a-z and A-Z, the digits 0-9, braces ({ and }) and underscore ( ).<br />

Some examples of legal names:<br />

an unquoted name<br />

another name{123}<br />

’single quoted name’<br />

"double quoted name"<br />

"name with \\"quote\\" in it"<br />

"name with []s in it"<br />

F.3.3<br />

Parameters section<br />

In the vendor section solver parameters are defined inside the parameters subsection. Each parameter<br />

is written as<br />

[p PARAMETER NAME] value [/p]<br />

where PARAMETER NAME is replaced by a <strong>MOSEK</strong> parameter name, usually of the form MSK IPAR ...,<br />

MSK DPAR ... or MSK SPAR ..., and the value is replaced by the value of that parameter; both integer<br />

values and named values may be used. Some simple examples are:<br />

[vendor mosek]<br />

[parameters]<br />

[p MSK IPAR OPF MAX TERMS PER LINE] 10 [/p]<br />

[p MSK IPAR OPF WRITE PARAMETERS] MSK ON [/p]<br />

[p MSK DPAR DATA TOL BOUND INF] 1.0e18 [/p]<br />

[/parameters]<br />

[/vendor]<br />

F.3.4<br />

Writing OPF files from <strong>MOSEK</strong><br />

<strong>The</strong> function Task.writedata can be used to produce an OPF file from a task.<br />

To write an OPF file set the parameter iparam.write data format to dataformat.op as this ensures<br />

that OPF format is used. <strong>The</strong>n modify the following parameters to define what the file should contain:<br />

• iparam.opf write header, include a small header with comments.<br />

• iparam.opf write hints, include hints about the size of the problem.<br />

• iparam.opf write problem, include the problem itself — objective, constraints and bounds.<br />

• iparam.opf write solutions, include solutions if they are defined. If this is off, no solutions<br />

are included.<br />

• iparam.opf write sol bas, include basic solution, if defined.

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

Saved successfully!

Ooh no, something went wrong!