www.pudn.com > RobustSF.zip > compute_laplase.m, change:2014-09-18,size:404b


function [L] = compute_laplase( X,tr_label ) 
% [~,n]=size(X); 
% W=zeros(n,n); 
% for i=1:n 
%     for j=i:n 
%         W(i,j)=norm(X(:,i)-X(:,j)); 
%         W(j,i)=W(i,j); 
%     end 
% end 
% Dw=sum(W'); 
% L=diag(Dw)-W; 
 
[~,n]=size(X); 
W=ones(n,n); 
nclass=length(unique(tr_label)); 
for i=1:nclass 
    index=find(tr_label==i); 
    W(index,index)=1e-1; 
end 
Dw=sum(W'); 
L=diag(Dw)-W; 
end