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.

90 CHAPTER 7. ADVANCED <strong>API</strong> TUTORIAL<br />

2 #<br />

Please note the ordering of the columns in B .<br />

<strong>The</strong> following program demonstrates the use of Task.solvewithbasis.<br />

[ solvebasis.py ]<br />

3 # Copyright: Copyright (c) <strong>MOSEK</strong> ApS, Denmark. All rights reserved.<br />

4 #<br />

5 # File : solvebasis.py<br />

6 #<br />

7 # Purpose : To demonstrate the usage of<br />

8 # MSK solvewithbasis on the problem:<br />

9 #<br />

10 # maximize x0 + x1<br />

11 # st.<br />

12 # x0 + 2.0 x1 = 0<br />

15 #<br />

16 # <strong>The</strong> problem has the slack variables<br />

17 # xc0, xc1 on the constraints<br />

18 # and the variabels x0 and x1.<br />

19 #<br />

20 # maximize x0 + x1<br />

21 # st.<br />

22 # x0 + 2.0 x1 -xc1 = 2<br />

23 # x0 + x1 -xc2 = 6<br />

24 # x0 >= 0, x1>= 0,<br />

25 # xc1

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

Saved successfully!

Ooh no, something went wrong!