comparison toolboxes/distance_learning/mlr/feasible/feasibleFull.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 function W = feasibleFull(W)
2 %
3 % W = feasibleFull(W)
4 %
5 % Projects a single d*d matrix onto the PSD cone
6 %
7
8 global FEASIBLE_COUNT;
9 FEASIBLE_COUNT = FEASIBLE_COUNT + 1;
10
11 [v,d] = eig(0.5 * (W + W'));
12 W = v * bsxfun(@times, max(real(diag(d)),0), v');
13 end
14