iota-0.1.0.0
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.UnionFind

Synopsis

Documentation

newtype UnionFind s Source #

Constructors

UF 

Fields

newUnionFind :: PrimMonad m => Int -> m (UnionFind (PrimState m)) Source #

freezeUnionFind :: PrimMonad m => UnionFind (PrimState m) -> m (Vector Int) Source #

findUF :: PrimMonad m => UnionFind (PrimState m) -> Int -> m Int Source #

sizeUF :: PrimMonad m => UnionFind (PrimState m) -> Int -> m Int Source #

uniteUF :: PrimMonad m => UnionFind (PrimState m) -> Int -> Int -> m Bool Source #

uniteUF_ :: PrimMonad m => UnionFind (PrimState m) -> Int -> Int -> m () Source #

equivUF :: PrimMonad m => UnionFind (PrimState m) -> Int -> Int -> m Bool Source #

countGroupUF :: PrimMonad m => UnionFind (PrimState m) -> m Int Source #

O(n)