The MOSEK Python optimizer API manual Version 7.0 (Revision 141)
Optimizer API for Python - Documentation - Mosek Optimizer API for Python - Documentation - Mosek
260 APPENDIX A. API REFERENCE Computes the violation of a solution for set of conic constraints. Arguments sub : int[] An array of indexes of ¯X variables. viol : double[] viol[k] violation of the solution associated with sub[k]’th conic constraint. whichsol : soltype Selects a solution. Description: Let x ∗ be the value of variable x for the specified solution. For simplicity let us assume that x is a member of quadratic cone, then the violation is computed as follows { max(0, ‖x2;n ‖ − x 1 )/ √ 2, x 1 ≥ − ‖x 2:n ‖ , ‖x‖ , otherwise. Both when the solution is a certificate of dual infeasibility or when it is a primal feasibible solution the violation should be small. A.2.113 Task.getpviolvar() Task.getpviolvar( whichsol, sub, viol) Computes the violation of a primal solution for a list of x variables. Arguments sub : int[] An array of indexes of x variables. viol : double[] viol[k] is the violation associated the solution for variable x j . whichsol : soltype Selects a solution. Description: Let x ∗ j be the value of variable x j for the specified solution. Then the primal violation of the solution associated with variable x j is given by
A.2. CLASS TASK 261 max(l x j τ − x ∗ j , x ∗ j − u x j τ). where τ is defined as follows. If the solution is a certificate of dual infeasibility, then τ = 0 and otherwise τ = 1. Both when the solution is a valid certificate of dual infeasibility or when it is primal feasibible solution the violation should be small. A.2.114 Task.getqconk() numqcnz = Task.getqconk( k, qcsubi, qcsubj, qcval) Obtains all the quadratic terms in a constraint. Arguments k : int Which constraint. numqcnz : long Number of quadratic terms. qcsubi : int[] Row subscripts for quadratic constraint matrix. qcsubj : int[] Column subscripts for quadratic constraint matrix. qcval : double[] Quadratic constraint coefficient values. Description: Obtains all the quadratic terms in a constraint. The quadratic terms are stored sequentially qcsubi, qcsubj, and qcval. A.2.115 Task.getqobj() numqonz = Task.getqobj( qosubi, qosubj, qoval) Obtains all the quadratic terms in the objective.
- Page 231 and 232: A.2. CLASS TASK 209 Description: Ap
- Page 233 and 234: A.2. CLASS TASK 211 Description: If
- Page 235 and 236: A.2. CLASS TASK 213 A.2.16 Task.com
- Page 237 and 238: A.2. CLASS TASK 215 subj : int[] In
- Page 239 and 240: A.2. CLASS TASK 217 firsti : int In
- Page 241 and 242: A.2. CLASS TASK 219 A.2.27 Task.get
- Page 243 and 244: A.2. CLASS TASK 221 valijkl : Descr
- Page 245 and 246: A.2. CLASS TASK 223 A.2.33 Task.get
- 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: A.2. CLASS TASK 259 Description: Le
- 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 and 298: A.2. CLASS TASK 275 A.2.133 Task.ge
- Page 299 and 300: A.2. CLASS TASK 277 last : int Valu
- 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
260 APPENDIX A. <strong>API</strong> REFERENCE<br />
Computes the violation of a solution for set of conic constraints.<br />
Arguments<br />
sub : int[]<br />
An array of indexes of ¯X variables.<br />
viol : double[]<br />
viol[k] violation of the solution associated with sub[k]’th conic constraint.<br />
whichsol : soltype<br />
Selects a solution.<br />
Description:<br />
Let x ∗ be the value of variable x for the specified solution. For simplicity let us assume that x<br />
is a member of quadratic cone, then the violation is computed as follows<br />
{<br />
max(0, ‖x2;n ‖ − x 1 )/ √ 2, x 1 ≥ − ‖x 2:n ‖ ,<br />
‖x‖ ,<br />
otherwise.<br />
Both when the solution is a certificate of dual infeasibility or when it is a primal feasibible<br />
solution the violation should be small.<br />
A.2.113<br />
Task.getpviolvar()<br />
Task.getpviolvar(<br />
whichsol,<br />
sub,<br />
viol)<br />
Computes the violation of a primal solution for a list of x variables.<br />
Arguments<br />
sub : int[]<br />
An array of indexes of x variables.<br />
viol : double[]<br />
viol[k] is the violation associated the solution for variable x j .<br />
whichsol : soltype<br />
Selects a solution.<br />
Description:<br />
Let x ∗ j be the value of variable x j for the specified solution. <strong>The</strong>n the primal violation of the<br />
solution associated with variable x j is given by