Skip to content

Commit bd39f5f

Browse files
committed
Add a docstring for the structure Forest
1 parent e11e345 commit bd39f5f

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

docs/src/dev.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ SparseMatrixColorings.symmetric_coefficient
2626
SparseMatrixColorings.star_coloring
2727
SparseMatrixColorings.acyclic_coloring
2828
SparseMatrixColorings.group_by_color
29+
SparseMatrixColorings.Forest
2930
SparseMatrixColorings.StarSet
3031
SparseMatrixColorings.TreeSet
3132
```

src/forest.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
1+
## Forest
2+
3+
"""
4+
$TYPEDEF
5+
6+
Structure that provides fast union-find operations for constructing a forest during acyclic coloring and bicoloring.
7+
8+
# Fields
9+
"""
10+
$TYPEDFIELDS
111
mutable struct Forest{T<:Integer}
12+
"current number of edges added to the forest"
213
counter::T
14+
"dictionary mapping each edge represented as a tuple of vertices to its unique integer index"
315
intmap::Dict{Tuple{T,T},T}
16+
"vector storing the index of a parent in the tree for each edge, used in union-find operations"
417
parents::Vector{T}
18+
"vector approximating the depth of each tree to optimize path compression"
519
ranks::Vector{T}
20+
"current number of distinct trees in the forest"
621
ntrees::T
722
end
823

0 commit comments

Comments
 (0)