diff options
author | Ulrich Bauer <mail@ulrich-bauer.org> | 2018-05-19 14:25:33 -0400 |
---|---|---|
committer | Ulrich Bauer <mail@ulrich-bauer.org> | 2018-05-19 14:25:33 -0400 |
commit | aea14fcfd06f45b7f20ee54660129c92828946ad (patch) | |
tree | 3f89c27056fa5701a61cfe70c36779d3df44e827 | |
parent | 563580c2b007008bbb5b9d5194ab937402099fdb (diff) | |
parent | ff4b0cc4012e1cdc8ebe0ae5cdc613352b9f8bac (diff) |
Merge branch 'dev' into sparse-distance-matrix
# Conflicts:
# ripser.cpp
-rw-r--r-- | ripser.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
@@ -269,23 +269,16 @@ public: } index_t find(index_t x) { - index_t y = x, z = parent[y]; - while (z != y) { - y = z; - z = parent[y]; - } - y = parent[x]; - while (z != y) { - parent[x] = z; - x = y; - y = parent[x]; + index_t y = x, z; + while ((z = parent[y]) != y) y = z; + while ((z = parent[x]) != y) { + parent[x] = y; + x = z; } return z; } void link(index_t x, index_t y) { - x = find(x); - y = find(y); - if (x == y) return; + if ((x = find(x)) == (y = find(y))) return; if (rank[x] > rank[y]) parent[y] = x; else { |