wolffd@0: function W = feasibleFull(W) wolffd@0: % wolffd@0: % W = feasibleFull(W) wolffd@0: % wolffd@0: % Projects a single d*d matrix onto the PSD cone wolffd@0: % wolffd@0: wolffd@0: global FEASIBLE_COUNT; wolffd@0: FEASIBLE_COUNT = FEASIBLE_COUNT + 1; wolffd@0: wolffd@0: [v,d] = eig(0.5 * (W + W')); wolffd@0: W = v * bsxfun(@times, max(real(diag(d)),0), v'); wolffd@0: end wolffd@0: