1 function [A,B] = compute_relation2(data,scale_sig,order)
\r
3 % [W,Dist] = compute_relation(data,scale_sig)
\r
4 % Input: data= Feature_dimension x Num_data
\r
5 % ouput: W = pair-wise data similarity matrix
\r
6 % Dist = pair-wise Euclidean distance
\r
11 if (~exist('order')),
\r
20 B(:,j) = (sqrt((data(1,:)-data(1,j)).^2 +...
\r
21 (data(2,:)-data(2,j)).^2))';
\r
24 if (~exist('scale_sig')),
\r
25 scale_sig = 0.05*max(B(:));
\r
26 % scale_sig = 0.04*max(B(:));
\r
32 % [ignore,ind] = sort(B(:,j));
\r
33 % B2(ind(kNN+1:end),j) = Inf;
\r
34 % B2(ind(1:kNN),j) = B(ind(1:kNN),j) / max(B(ind(1:kNN),j)) * 0.5;
\r
37 % B = min(B2,B2');%(B+B')/2;
\r
39 tmp = (B/scale_sig).^order;
\r