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

276 APPENDIX A. API REFERENCE pviolvar : double Maximal primal violation of the solution for the x x variables where the violations are computed by Task.getpviolvar. whichsol : soltype Selects a solution. Description: See also Obtains information about a solution. • Task.getsolsta Obtains the solution status. • Task.getprimalobj Computes the primal objective value for the desired solution. • Task.getpviolcon Computes the violation of a primal solution for a list of xc variables. • Task.getpviolvar Computes the violation of a primal solution for a list of x variables. • Task.getpviolbarvar Computes the violation of a primal solution for a list of barx variables. • Task.getpviolcones Computes the violation of a solution for set of conic constraints. • Task.getdualobj Computes the dual objective value associated with the solution. • Task.getdviolcon Computes the violation of a dual solution associated with a set of constraints. • Task.getdviolvar Computes the violation of a dual solution associated with a set of x variables. • Task.getdviolbarvar Computes the violation of dual solution for a set of barx variables. • Task.getdviolcones Computes the violation of a solution for set of dual conic constraints. A.2.134 Task.getsolutionslice() Task.getsolutionslice( whichsol, solitem, first, last, values) Obtains a slice of the solution. Arguments first : int Index of the first value in the slice.

A.2. CLASS TASK 277 last : int Value of the last index+1 in the slice, e.g. if xx[5, . . . , 9] is required last should be 10. solitem : solitem Which part of the solution is required. values : double[] The values in the required sequence are stored sequentially in values starting at values[0]. whichsol : soltype Selects a solution. Description: Obtains a slice of the 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. The solitem argument determines which part of the solution is returned: solitem.xx: The variable values return x. solitem.y: The variable values return y. solitem.slc: The variable values return s c l . solitem.suc: The variable values return s c u. solitem.slx: The variable values return s x l . solitem.sux: The variable values return s x u. A conic optimization problem has the same primal variables as in the linear case. Recall that the dual of a conic optimization problem is given by:

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

pviolvar : double<br />

Maximal primal violation of the solution for the x x variables where the violations are computed<br />

by Task.getpviolvar.<br />

whichsol : soltype<br />

Selects a solution.<br />

Description:<br />

See also<br />

Obtains information about a solution.<br />

• Task.getsolsta Obtains the solution status.<br />

• Task.getprimalobj Computes the primal objective value for the desired solution.<br />

• Task.getpviolcon Computes the violation of a primal solution for a list of xc variables.<br />

• Task.getpviolvar Computes the violation of a primal solution for a list of x variables.<br />

• Task.getpviolbarvar Computes the violation of a primal solution for a list of barx variables.<br />

• Task.getpviolcones Computes the violation of a solution for set of conic constraints.<br />

• Task.getdualobj Computes the dual objective value associated with the solution.<br />

• Task.getdviolcon Computes the violation of a dual solution associated with a set of constraints.<br />

• Task.getdviolvar Computes the violation of a dual solution associated with a set of x<br />

variables.<br />

• Task.getdviolbarvar Computes the violation of dual solution for a set of barx variables.<br />

• Task.getdviolcones Computes the violation of a solution for set of dual conic constraints.<br />

A.2.134<br />

Task.getsolutionslice()<br />

Task.getsolutionslice(<br />

whichsol,<br />

solitem,<br />

first,<br />

last,<br />

values)<br />

Obtains a slice of the solution.<br />

Arguments<br />

first : int<br />

Index of the first value in the slice.

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

Saved successfully!

Ooh no, something went wrong!