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.

5.3. CONIC QUADRATIC OPTIMIZATION 37<br />

56 aval = [ array([1.0]), array([1.0]), array([2.0]) ]<br />

57<br />

58<br />

59 numvar = len(bkx)<br />

60 numcon = len(bkc)<br />

61 NUMANZ = 4<br />

62 # Append ’numcon’ empty constraints.<br />

63 # <strong>The</strong> constraints will initially have no bounds.<br />

64 task.appendcons(numcon)<br />

65<br />

66 #Append ’numvar’ variables.<br />

67 # <strong>The</strong> variables will initially be fixed at zero (x=0).<br />

68 task.appendvars(numvar)<br />

69<br />

70 for j in range(numvar):<br />

71 # Set the linear term c j in the objective.<br />

72 task.putcj(j,c[j])<br />

73 # Set the bounds on variable j<br />

74 # blx[j]

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

Saved successfully!

Ooh no, something went wrong!