The MOSEK Python optimizer API manual Version 7.0 (Revision 141)
Optimizer API for Python - Documentation - Mosek Optimizer API for Python - Documentation - Mosek
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:
- Page 247 and 248: A.2. CLASS TASK 225 idx : long Inde
- Page 249 and 250: A.2. CLASS TASK 227 A.2.41 Task.get
- Page 251 and 252: A.2. CLASS TASK 229 i : int Index o
- Page 253 and 254: A.2. CLASS TASK 231 A.2.49 Task.get
- Page 255 and 256: A.2. CLASS TASK 233 conetype : cone
- Page 257 and 258: A.2. CLASS TASK 235 Description: Ob
- Page 259 and 260: A.2. CLASS TASK 237 sub : int[] Ind
- Page 261 and 262: A.2. CLASS TASK 239 A.2.64 Task.get
- Page 263 and 264: A.2. CLASS TASK 241 Computes the vi
- Page 265 and 266: A.2. CLASS TASK 243 A.2.71 Task.get
- Page 267 and 268: A.2. CLASS TASK 245 A.2.75 Task.get
- Page 269 and 270: A.2. CLASS TASK 247 A.2.80 Task.get
- Page 271 and 272: A.2. CLASS TASK 249 A.2.86 Task.get
- Page 273 and 274: A.2. CLASS TASK 251 A.2.92 Task.get
- Page 275 and 276: A.2. CLASS TASK 253 k : int Index o
- Page 277 and 278: A.2. CLASS TASK 255 A.2.103 Task.ge
- Page 279 and 280: A.2. CLASS TASK 257 normalize : int
- Page 281 and 282: A.2. CLASS TASK 259 Description: Le
- Page 283 and 284: A.2. CLASS TASK 261 max(l x j τ
- Page 285 and 286: A.2. CLASS TASK 263 A.2.117 Task.ge
- Page 287 and 288: A.2. CLASS TASK 265 last : int Last
- Page 289 and 290: A.2. CLASS TASK 267 A.2.124 Task.ge
- Page 291 and 292: A.2. CLASS TASK 269 Arguments snx :
- Page 293 and 294: A.2. CLASS TASK 271 slc : double[]
- Page 295 and 296: A.2. CLASS TASK 273 Arguments accmo
- Page 297: A.2. CLASS TASK 275 A.2.133 Task.ge
- Page 301 and 302: A.2. CLASS TASK 279 subi : int[] Ro
- Page 303 and 304: A.2. CLASS TASK 281 Description: Ob
- Page 305 and 306: A.2. CLASS TASK 283 Arguments taskn
- Page 307 and 308: A.2. CLASS TASK 285 A.2.148 Task.ge
- Page 309 and 310: A.2. CLASS TASK 287 vartype : varia
- Page 311 and 312: A.2. CLASS TASK 289 whichsol : solt
- Page 313 and 314: A.2. CLASS TASK 291 Description: Ob
- Page 315 and 316: A.2. CLASS TASK 293 A.2.162 Task.is
- Page 317 and 318: A.2. CLASS TASK 295 whichstream : s
- Page 319 and 320: A.2. CLASS TASK 297 A.2.170 Task.pr
- Page 321 and 322: A.2. CLASS TASK 299 markj : mark Th
- Page 323 and 324: A.2. CLASS TASK 301 Prints a part o
- Page 325 and 326: A.2. CLASS TASK 303 A.2.175 Task.pu
- Page 327 and 328: A.2. CLASS TASK 305 j : int Index o
- Page 329 and 330: A.2. CLASS TASK 307 A.2.180 Task.pu
- Page 331 and 332: A.2. CLASS TASK 309 Description: Th
- Page 333 and 334: A.2. CLASS TASK 311 A.2.186 Task.pu
- Page 335 and 336: A.2. CLASS TASK 313 Changes the bou
- Page 337 and 338: A.2. CLASS TASK 315 Modifies one li
- Page 339 and 340: A.2. CLASS TASK 317 bkc : boundkey
- Page 341 and 342: A.2. CLASS TASK 319 Arguments j : i
- Page 343 and 344: A.2. CLASS TASK 321 parvalue : int
- Page 345 and 346: A.2. CLASS TASK 323 A.2.207 Task.pu
- Page 347 and 348: A.2. CLASS TASK 325 Sets a string p
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.