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

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.

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

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

Saved successfully!

Ooh no, something went wrong!