function [F_struc,K,c,Q,UB,LB,x0,Qi,Li,ri] = append_normalized_socp(F_struc,K,c,Q,UB,LB,x0) if K.q(1)>0 % We don't support initials here yet x0 = []; % To simplify code, we currently normalize everything to z'*z 7 % Cplex interface needs explicit representations of z'Q*z+Lz+r top = nOriginal+1; ri = zeros(1,length(K.q)); Li = spalloc(nOriginal+nNew,length(K.q),0); nTotal = nOriginal+nNew; for i = 1:length(K.q); ind = top:top+K.q(i)-1; vals = [-1 ones(1,K.q(i)-1)]; aux = diag(sparse(ind,1,vals,nTotal,1)); Qi{i} = aux; top = top + K.q(i); end end else Qi = []; ri = []; Li = []; end