Handbook
Glossary
add-atom ( a disjoint-set -- )
Factor handbook
»
The language
»
Collections
»
Disjoint sets
Prev:
equiv-set-size ( a disjoint-set -- n )
Next:
equate ( a b disjoint-set -- )
Vocabulary
disjoint-sets
Inputs
a
an
object
disjoint-set
a
disjoint-set
Outputs
None
Word description
Adds a new element to the disjoint set, initially only equivalent to itself.
Definition
IN:
disjoint-sets
GENERIC:
add-atom
( a disjoint-set -- )
Methods
USING:
accessors
assocs
disjoint-sets
kernel
;
M:
disjoint-set
add-atom
[
dupd
parents>>
set-at
]
[
[
0
]
2dip
ranks>>
set-at
]
[
[
1
]
2dip
counts>>
set-at
]
2tri
;