function w=cleanmatrix(mat)
%usage: w=cleanmatrix(mat)
% dscrpt: zeros out entries <1e-16*||mat||_inf

xmat = 1e-16*norm(mat,inf);
w = (abs(mat) > xmat) .* mat;



