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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

328 APPENDIX A. <strong>API</strong> REFERENCE<br />

Description:<br />

Replaces all the quadratic entries in one constraint k of the form:<br />

l c k ≤ 1 2<br />

numvar−1<br />

∑<br />

i=0<br />

numvar−1<br />

∑<br />

j=0<br />

numvar−1<br />

∑<br />

qijx k i x j +<br />

j=0<br />

a kj x j ≤ u c k.<br />

It is assumed that Q k is symmetric, i.e. qij k = qk ji , and therefore, only the values of qk ij for which<br />

i ≥ j should be inputted to <strong>MOSEK</strong>. To be precise, <strong>MOSEK</strong> uses the following procedure<br />

Please note that:<br />

1. Q k = 0<br />

2. for t = 0 to numqonz − 1<br />

3. qqcsubi[t],qcsubj[t] k = qk qcsubi[t],qcsubj[t] + qcval[t]<br />

3. qqcsubj[t],qcsubi[t] k = qk qcsubj[t],qcsubi[t] + qcval[t]<br />

See also<br />

• For large problems it is essential for the efficiency that the function Task.putmaxnumqnz is<br />

employed to specify an appropriate maxnumqnz.<br />

• Only the lower triangular part should be specified because Q k is symmetric. Specifying<br />

values for qij k where i < j will result in an error.<br />

• Only non-zero elements should be specified.<br />

• <strong>The</strong> order in which the non-zero elements are specified is insignificant.<br />

• Duplicate elements are added together. Hence, it is recommended not to specify the same<br />

element multiple times in qosubi, qosubj, and qoval.<br />

For a code example see Section 5.5.2.<br />

• Task.putqcon Replaces all quadratic terms in constraints.<br />

• Task.putmaxnumqnz Changes the size of the preallocated storage for quadratic terms.<br />

A.2.217<br />

Task.putqobj()<br />

Task.putqobj(<br />

qosubi,<br />

qosubj,<br />

qoval)<br />

Replaces all quadratic terms in the objective.<br />

Arguments<br />

qosubi : int[]<br />

Row subscripts for quadratic objective coefficients.

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

Saved successfully!

Ooh no, something went wrong!