Permalink
Browse files

Added example to clustercoeffs

  • Loading branch information...
1 parent 6ce76e5 commit cd319a587a14fa21ccd2d03a67344c03dd233b33 David committed May 16, 2009
Showing with 12 additions and 2 deletions.
  1. +7 −2 clustercoeffs.m
  2. +5 −0 test/test_examples.m
View
@@ -8,11 +8,16 @@
% control normalization and weighted computation. If normalized=0 or
% false, then the computation is not normalized by d*(d-1) in the
% unweighted case. If weighted=0 or false, then the weights of the matrix
-% A are ignored.
+% A are ignored. Either parameter will assume it's default value if you
+% specify an empty matrix.
%
% See also DIRCLUSTERCOEFFS
%
% Example:
+% load_gaimc_graph('clique-10');
+% cc = clustercoeffs(A) % they are all equal! as we expect in a clique
+
+% TODO Example
if ~exist('normalized','var') || isempty(normalized), normalized=true; end
if ~exist('weighted','var') || isempty(weighted), weighted=true; end
@@ -37,7 +42,7 @@
end
n=length(rp)-1;
-cc=zeros(n,1); ind=false(n,1); cache=zeros(n,1); degs=zeros(n,1);
+cc=zeros(n,1); ind=false(n,1); cache=zeros(n,1);
ew=1; ew2=1;
for v=1:n
for rpi=rp(v):rp(v+1)-1
View
@@ -2,6 +2,11 @@
load_gaimc_graph('bfs_example.mat') % use the dfs example from Boost
d = bfs(A,1)
+%% clustercoeffs
+load_gaimc_graph('clique-10');
+cc = clustercoeffs(A) % they are all equal! as we expect in a clique
+
+
%% dfs
load_gaimc_graph('dfs_example.mat') % use the dfs example from Boost
d = dfs(A,1)

0 comments on commit cd319a5

Please sign in to comment.