forked from bartvdbraak/blender
90e5a9aa14
Requires some changes to projectfiles/makefiles/scons, for the added and removed files!
30 lines
380 B
C++
30 lines
380 B
C++
#ifndef UNION_FIND_H
|
|
#define UNION_FIND_H
|
|
|
|
///UnionFind calculates connected subsets
|
|
class UnionFind
|
|
{
|
|
private:
|
|
int* m_id;
|
|
int* m_sz;
|
|
int m_N;
|
|
|
|
public:
|
|
int find(int x);
|
|
|
|
UnionFind();
|
|
~UnionFind();
|
|
|
|
void reset(int N);
|
|
|
|
int find(int p, int q);
|
|
void unite(int p, int q);
|
|
|
|
void Allocate(int N);
|
|
void Free();
|
|
|
|
};
|
|
|
|
|
|
#endif //UNION_FIND_H
|