aboutsummaryrefslogtreecommitdiffstats
path: root/include/nvgpu/hashtable.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/nvgpu/hashtable.h')
0 files changed, 0 insertions, 0 deletions
0 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45












































                                                         
function [v,d] = ncut(A,nv)
%
%  [v,d] = ncut(A,nv)
%
%
%    computes 'nv' of the normalized cut vectors 'v' from
%    matrix 'A'
%
%    it computes the largest eigenvectors of
%      A*v = \lambda D * v;   D = diag(sum(A));
%
%    this is same as solving the smallest eigenvectors of
%     (D-A)*v = \lambda D *v;
%   

%
%  Jianbo Shi   
%

ds = sum(A);
ds = ones(size(ds))./sqrt(ds);

for j=1:size(A,1),
  A(j,:) = A(j,:).*ds;
end

for j=1:size(A,2);
  A(:,j) = A(:,j).*ds';
end


%disp(sprintf('computing eig values'));
OPTIONS.tol=1e-10;
OPTIONS.maxit=15;
OPTIONS.disp=0;
%tic;toc;

[v,d] = eigs(A,nv,OPTIONS);

d = abs(diag(d));

for j=1:nv,
  v(:,j) = v(:,j).*ds';
end