#pragma once #include namespace cgv { namespace data { struct union_find : public std::vector { /// construct with given number of elements union_find(unsigned int n) { init(n); } /// init such that each element is a representative void init(unsigned int n) { resize(n); for (unsigned int i=0; i