Handbook
Glossary
equate ( a b disjoint-set -- )
Factor handbook
»
The language
»
Collections
»
Disjoint sets
Prev:
add-atom ( a disjoint-set -- )
Vocabulary
disjoint-sets
Inputs
a
an
object
b
an
object
disjoint-set
a
disjoint-set
Outputs
None
Word description
Merges the equivalence classes of two elements, which must previously have been added with
add-atom
.
Definition
IN:
disjoint-sets
GENERIC:
equate
( a b disjoint-set -- )
Methods
USING:
disjoint-sets
disjoint-sets.private
kernel
;
M::
disjoint-set
equate
( a b disjoint-set -- )
a b disjoint-set
representatives
2dup
=
[
2drop
]
[
2dup
disjoint-set
ranks
[
swap
]
[
over
disjoint-set
inc-rank
]
[
]
branch
disjoint-set
link-sets
]
if
;