comparison toolboxes/distance_learning/mlr/feasible/feasibleFullMKL.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 = feasibleFullMKL(W)
2 %
3 % W = feasibleFullMKL(W)
4 %
5 % Projects a single d*d matrix onto the PSD cone
6 %
7 global FEASIBLE_COUNT;
8 m = size(W,3);
9 FEASIBLE_COUNT = FEASIBLE_COUNT + m;
10
11 parfor i = 1:m
12 [v,d] = eig(0.5 * (W(:,:,i) + W(:,:,i)'));
13 W(:,:,i) = v * bsxfun(@times, max(real(diag(d)),0), v');
14 end
15 end
16