% [At,b,c,K] = rls(P,q,rho)
% Creates dual standard form for robust least squares problem "Pu=q".
function [At,b,c,K] = rls(P,q,rho)
[d, r] = size(P);
% ---------- minimize t_1 + rho * t_2 ----------
b = -[1; rho; zeros(r,1)];
% ---------- (t_1, q - P v) in Qcone ----------
At = [-1, zeros(1,1+r); zeros(d,2), P];
c = [0;q];
K.q = [1+d];
% ---------- (t_2, v) in Qcone ----------
At = [At; 0, -1, zeros(1,r); zeros(r,2), eye(r)];
c = [c; 0;zeros(r,1)] ;
K.q = [K.q, 1+r] ;