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

220 APPENDIX A. API REFERENCE Obtains the number of non-zeros in a slice of rows or columns of the coefficient matrix. Arguments accmode : accmode Defines whether non-zeros are counted in a column slice or a row slice. first : int Index of the first row or column in the sequence. last : int Index of the last row or column plus one in the sequence. numnz : long Number of non-zeros in the slice. Description: Obtains the number of non-zeros in a slice of rows or columns of A. A.2.29 Task.getbarablocktriplet() num = Task.getbarablocktriplet( subi, subj, subk, subl, valijkl) Obtains barA in block triplet form. Arguments num : long Number of elements in the block triplet form. subi : int[] Constraint index. subj : int[] Symmetric matrix variable index. subk : int[] Block row index. subl : int[] Block column index.

A.2. CLASS TASK 221 valijkl : Description: double[] A list indexes of the elements from symmetric matrix storage that appers in the weighted sum. Obtains Ā in block triplet form. A.2.30 Task.getbaraidx() i,j,num = Task.getbaraidx( idx, sub, weights) Obtains information about an element barA. Arguments i : idx : j : num : sub : int Row index of the element at position idx. long Position of the element in the vectorized form. int Column index of the element at position idx. long Number of terms in weighted sum that forms the element. long[] A list indexes of the elements from symmetric matrix storage that appers in the weighted sum. weights : Description: double[] The weights associated with each term in the weighted sum. Obtains information about an element in Ā. Since Ā is a sparse matrix of symmetric matrixes then only the nonzero elements in Ā are stored in order to save space. Now Ā is stored vectorized form i.e. as one long vector. This function makes it possible to obtain information such as the row index and the column index of a particular element of the vectorized form of Ā. Please observe if one element of Ā is inputted multiple times then it may be stored several times in vectorized form. In that case the element with the highest index is the one that is used.

A.2. CLASS TASK 221<br />

valijkl :<br />

Description:<br />

double[]<br />

A list indexes of the elements from symmetric matrix storage that appers in the weighted<br />

sum.<br />

Obtains Ā in block triplet form.<br />

A.2.30<br />

Task.getbaraidx()<br />

i,j,num = Task.getbaraidx(<br />

idx,<br />

sub,<br />

weights)<br />

Obtains information about an element barA.<br />

Arguments<br />

i :<br />

idx :<br />

j :<br />

num :<br />

sub :<br />

int<br />

Row index of the element at position idx.<br />

long<br />

Position of the element in the vectorized form.<br />

int<br />

Column index of the element at position idx.<br />

long<br />

Number of terms in weighted sum that forms the element.<br />

long[]<br />

A list indexes of the elements from symmetric matrix storage that appers in the weighted<br />

sum.<br />

weights :<br />

Description:<br />

double[]<br />

<strong>The</strong> weights associated with each term in the weighted sum.<br />

Obtains information about an element in Ā. Since Ā is a sparse matrix of symmetric matrixes<br />

then only the nonzero elements in Ā are stored in order to save space. Now Ā is stored vectorized<br />

form i.e. as one long vector. This function makes it possible to obtain information such as the<br />

row index and the column index of a particular element of the vectorized form of Ā.<br />

Please observe if one element of Ā is inputted multiple times then it may be stored several times<br />

in vectorized form. In that case the element with the highest index is the one that is used.

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

Saved successfully!

Ooh no, something went wrong!