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

270 APPENDIX A. API REFERENCE A.2.129 Task.getsolsta() solsta = Task.getsolsta(whichsol) Obtains the solution status. Arguments solsta : solsta Solution status. whichsol : soltype Selects a solution. Description: Obtains the solution status. A.2.130 Task.getsolution() prosta,solsta = Task.getsolution( whichsol, skc, skx, skn, xc, xx, y, slc, suc, slx, sux, snx) Obtains the complete solution. Arguments prosta : prosta Problem status. skc : mosek.stakey[] Status keys for the constraints. skn : mosek.stakey[] Status keys for the conic constraints. skx : mosek.stakey[] Status keys for the variables.

A.2. CLASS TASK 271 slc : double[] Dual variables corresponding to the lower bounds on the constraints. slx : double[] Dual variables corresponding to the lower bounds on the variables. snx : double[] Dual variables corresponding to the conic constraints on the variables. solsta : solsta Solution status. suc : double[] Dual variables corresponding to the upper bounds on the constraints. sux : double[] Dual variables corresponding to the upper bounds on the variables. whichsol : soltype Selects a solution. xc : double[] Primal constraint solution. xx : double[] Primal variable solution. y : double[] Vector of dual variables corresponding to the constraints. Description: Obtains the complete solution. Consider the case of linear programming. The primal problem is given by and the corresponding dual problem is minimize c T x + c f subject to l c ≤ Ax ≤ u c , l x ≤ x ≤ u x . maximize (l c ) T s c l − (u c ) T s c u + (l x ) T s x l − (u x ) T s x u + c f subject to A T y + s x l − s x u = c, − y + s c l − s c u = 0, s c l , s c u, s x l , s x u ≥ 0. In this case the mapping between variables and arguments to the function is as follows: xx: Corresponds to variable x.

A.2. CLASS TASK 271<br />

slc : double[]<br />

Dual variables corresponding to the lower bounds on the constraints.<br />

slx : double[]<br />

Dual variables corresponding to the lower bounds on the variables.<br />

snx : double[]<br />

Dual variables corresponding to the conic constraints on the variables.<br />

solsta : solsta<br />

Solution status.<br />

suc : double[]<br />

Dual variables corresponding to the upper bounds on the constraints.<br />

sux : double[]<br />

Dual variables corresponding to the upper bounds on the variables.<br />

whichsol : soltype<br />

Selects a solution.<br />

xc : double[]<br />

Primal constraint solution.<br />

xx : double[]<br />

Primal variable solution.<br />

y : double[]<br />

Vector of dual variables corresponding to the constraints.<br />

Description:<br />

Obtains the complete solution.<br />

Consider the case of linear programming. <strong>The</strong> primal problem is given by<br />

and the corresponding dual problem is<br />

minimize<br />

c T x + c f<br />

subject to l c ≤ Ax ≤ u c ,<br />

l x ≤ x ≤ u x .<br />

maximize (l c ) T s c l − (u c ) T s c u<br />

+ (l x ) T s x l − (u x ) T s x u + c f<br />

subject to A T y + s x l − s x u = c,<br />

− y + s c l − s c u = 0,<br />

s c l , s c u, s x l , s x u ≥ 0.<br />

In this case the mapping between variables and arguments to the function is as follows:<br />

xx:<br />

Corresponds to variable x.

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

Saved successfully!

Ooh no, something went wrong!