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

Optimizer API for Python - Documentation - Mosek Optimizer API for Python - Documentation - Mosek

25.11.2015 Views

602 APPENDIX F. MOSEK FILE FORMATS F.2.1.4 Variable types The final two sections are optional and must begin with one of the keywords bin binaries binary and gen general Under general all integer variables are listed, and under binary all binary (integer variables with bounds 0 and 1) are listed: general x1 x2 binary x3 x4 Again, all variables listed in the binary or general sections must occur in either the objective or a constraint. F.2.1.5 Terminating section Finally, an LP formatted file must be terminated with the keyword end F.2.1.6 Linear example lo1.lp A simple example of an LP file is: \ File: lo1.lp maximize obj: 3 x1 + x2 + 5 x3 + x4 subject to c1: 3 x1 + x2 + 2 x3 = 30 c2: 2 x1 + x2 + 3 x3 + x4 >= 15 c3: 2 x2 + 3 x4

F.2. THE LP FILE FORMAT 603 bounds 0

602 APPENDIX F. <strong>MOSEK</strong> FILE FORMATS<br />

F.2.1.4<br />

Variable types<br />

<strong>The</strong> final two sections are optional and must begin with one of the keywords<br />

bin<br />

binaries<br />

binary<br />

and<br />

gen<br />

general<br />

Under general all integer variables are listed, and under binary all binary (integer variables with<br />

bounds 0 and 1) are listed:<br />

general<br />

x1 x2<br />

binary<br />

x3 x4<br />

Again, all variables listed in the binary or general sections must occur in either the objective or a<br />

constraint.<br />

F.2.1.5<br />

Terminating section<br />

Finally, an LP formatted file must be terminated with the keyword<br />

end<br />

F.2.1.6<br />

Linear example lo1.lp<br />

A simple example of an LP file is:<br />

\ File: lo1.lp<br />

maximize<br />

obj: 3 x1 + x2 + 5 x3 + x4<br />

subject to<br />

c1: 3 x1 + x2 + 2 x3 = 30<br />

c2: 2 x1 + x2 + 3 x3 + x4 >= 15<br />

c3: 2 x2 + 3 x4

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

Saved successfully!

Ooh no, something went wrong!