Blender  V3.3
Public Member Functions | List of all members
blender::DisjointSet Class Reference

#include <BLI_disjoint_set.hh>

Public Member Functions

 DisjointSet (int64_t size)
 
void join (int64_t x, int64_t y)
 
bool in_same_set (int64_t x, int64_t y)
 
int64_t find_root (int64_t x)
 

Detailed Description

Definition at line 15 of file BLI_disjoint_set.hh.

Constructor & Destructor Documentation

◆ DisjointSet()

blender::DisjointSet::DisjointSet ( int64_t  size)
inline

Create a new disjoint set with the given size. Initially, every element is in a separate set.

Definition at line 24 of file BLI_disjoint_set.hh.

References BLI_assert, and size().

Member Function Documentation

◆ find_root()

int64_t blender::DisjointSet::find_root ( int64_t  x)
inline

◆ in_same_set()

bool blender::DisjointSet::in_same_set ( int64_t  x,
int64_t  y 
)
inline

Return true when x and y are in the same set.

Definition at line 60 of file BLI_disjoint_set.hh.

References find_root().

Referenced by blender::tests::TEST().

◆ join()

void blender::DisjointSet::join ( int64_t  x,
int64_t  y 
)
inline

The documentation for this class was generated from the following file: