summaryrefslogtreecommitdiff
path: root/lib/include
diff options
context:
space:
mode:
Diffstat (limited to 'lib/include')
-rw-r--r--lib/include/clusters.hpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/include/clusters.hpp b/lib/include/clusters.hpp
index 0c562d8..0728b3e 100644
--- a/lib/include/clusters.hpp
+++ b/lib/include/clusters.hpp
@@ -8,9 +8,7 @@ private:
std::vector<unsigned> o;
public:
- std::vector<unsigned> c;
-
- ClusterTree(unsigned n) : p(n, -1), o(n, 1), c(n, 0) { c[0] = n; }
+ ClusterTree(unsigned n) : p(n, -1), o(n, 1) {}
unsigned findroot(unsigned i) {
if (p[i] < 0)
@@ -20,17 +18,12 @@ public:
}
void join(unsigned i, unsigned j) {
- c[o[i] - 1]--;
- c[o[j] - 1]--;
-
if (o[i] < o[j]) {
p[i] = j;
o[j] += o[i];
- c[o[j] - 1]++;
} else {
p[j] = i;
o[i] += o[j];
- c[o[i] - 1]++;
}
}