ivan@155: function [Phiout,unhatnz] = dict_update_MAP_cn(Phi,x,unhat,mu,maxIT,eps,cvset) ivan@155: %% Maximum A Posteriori Dictionary Update with the constraint on the column norms %%%%% ivan@155: ivan@155: ivan@155: ivan@155: %% ivan@155: ivan@155: K = Phi; ivan@155: B = zeros(size(Phi,1),size(Phi,2)); ivan@155: i = 1; ivan@155: %% ivan@155: while (sum(sum((B-K).^2))>eps)&&(i<=maxIT) ivan@155: B = K; ivan@155: for j = 1:size(K,2), ivan@155: K(:,j) = K(:,j) - mu*(eye(size(K,1))-K(:,j)*K(:,j)')*(K*unhat-x)*unhat(j,:)'; ivan@155: end ivan@155: i = i+1; ivan@155: end ivan@155: ivan@155: %% depleted atoms cancellation %%% ivan@155: ivan@155: [Y,I] = sort(sum(K.^2),'descend'); ivan@155: RR = sum(Y>=.01); ivan@155: Phiout = K(:,I(1:RR)); ivan@155: unhatnz = unhat(I(1:RR),:); ivan@155: ivan@155: end