pan>
0213   idx = 1;          <span class="comment">% index to _val/_row/_col arrays</span>
0214   <span class="keyword">for</span> midx=1:nK
0215     idxend = idx+K_nnz(midx)-1;
0216     Qi = sparse(K_row(idx:idxend)+1, K_col(idx:idxend)+1, K_val(idx:idxend),<span class="keyword">...</span>
0217       dim, dim, K_nnz(midx));
0218     <span class="comment">% symmetrize, was just upper triangle</span>
0219     Qi = Qi + triu(Qi,1)';
0220     <span class="comment">% swap sign, we want Ak &gt;= 0 (pos. def.) a