Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
markopy committed Oct 3, 2020
1 parent 1a5a81f commit fcb49f3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hdbscan/_hdbscan_linkage.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,16 @@ cdef class UnionFind (object):
return

cdef np.intp_t fast_find(self, np.intp_t n):
cdef np.intp_t p
cdef np.intp_t p, tmp
p = n
while self.parent[n] != -1:
n = self.parent[n]
# label up to the root if this is not the root already
if p != n:
while self.parent[p] != n:
p, self.parent[p] = self.parent[p], n
tmp = self.parent[p]
self.parent[p] = n
p = tmp
return n


Expand Down

0 comments on commit fcb49f3

Please sign in to comment.