Skip to content

Commit

Permalink
Use local cluster function only in octave, not in Matlab.
Browse files Browse the repository at this point in the history
  • Loading branch information
bilderbuchi committed May 18, 2011
1 parent 18d32a6 commit c3b6b9f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 5 additions & 1 deletion bbox/bb_cluster.m
Expand Up @@ -33,7 +33,11 @@
otherwise
bbd = bb_distance(bb2);
Z = linkagemex(bbd,'si');
T = cluster(Z,'cutoff', SPACE_THR,'criterion','distance');
if exist('OCTAVE_VERSION')
T = cluster_oct(Z,'cutoff', SPACE_THR,'criterion','distance');
else
T = cluster(Z,'cutoff', SPACE_THR,'criterion','distance');
end
end
uT = unique(T);

Expand Down
6 changes: 5 additions & 1 deletion bbox/bb_cluster_confidence.m
Expand Up @@ -39,7 +39,11 @@
otherwise
bbd = bb_distance(iBB);
Z = linkagemex(bbd,'si');
T = cluster(Z,'cutoff', SPACE_THR,'criterion','distance');
if exist('OCTAVE_VERSION')
T = cluster_oct(Z,'cutoff', SPACE_THR,'criterion','distance');
else
T = cluster(Z,'cutoff', SPACE_THR,'criterion','distance');
end
end

idx_cluster = unique(T);
Expand Down
4 changes: 2 additions & 2 deletions tld/cluster.m → tld/cluster_oct.m
@@ -1,5 +1,5 @@
function T = cluster(Z, varargin)
%CLUSTER Construct clusters from a hierarchical cluster tree.
function T = cluster_oct(Z, varargin)
%CLUSTER Construct clusters from a hierarchical cluster tree. [octave inclusion version]
% T = CLUSTER(Z,'Cutoff',C) constructs clusters from the hierarchical
% cluster tree represented by Z. Z is a (M-1)-by-3 matrix, generated by
% LINKAGE. C is a threshold for defining clusters. Starting from the
Expand Down

0 comments on commit c3b6b9f

Please sign in to comment.