Add documentation to every function and automatic doc html building (#6)
Reviewed-on: Rubydragon/MetagraphOptimization.jl#6 Co-authored-by: Anton Reinhard <anton.reinhard@proton.me> Co-committed-by: Anton Reinhard <anton.reinhard@proton.me>
This commit is contained in:
@ -1,4 +1,8 @@
|
||||
# check whether the given graph is connected
|
||||
"""
|
||||
is_connected(graph::DAG)
|
||||
|
||||
Return whether the given graph is connected.
|
||||
"""
|
||||
function is_connected(graph::DAG)
|
||||
nodeQueue = Deque{Node}()
|
||||
push!(nodeQueue, get_exit_node(graph))
|
||||
@ -16,6 +20,11 @@ function is_connected(graph::DAG)
|
||||
return length(seenNodes) == length(graph.nodes)
|
||||
end
|
||||
|
||||
"""
|
||||
is_valid(graph::DAG)
|
||||
|
||||
Validate the entire graph using asserts. Intended for testing with `@assert is_valid(graph)`.
|
||||
"""
|
||||
function is_valid(graph::DAG)
|
||||
for node in graph.nodes
|
||||
@assert is_valid(graph, node)
|
||||
|
Reference in New Issue
Block a user