Skip to content

Commit

Permalink
dot with nodes and edges, but little testing
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewcooke committed Oct 12, 2015
1 parent beba969 commit 36b7d9c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/dot/DOT.jl
Original file line number Diff line number Diff line change
Expand Up @@ -219,16 +219,16 @@ function parse_dot(s; debug=false)
end


# expend both nodes and edges, then use sets to de-duplication
# this generates a simple, flattened set of all node IDs
# set of all nodes
# expand both nodes and edges, then use sets to de-duplication
nodes(g::Graph) = union(map(nodes, g.stmts)...)
nodes(s::Statement) = Set()
nodes(s::SubGraph) = union(map(nodes, s.stmts)...)
nodes(n::Node) = nodes(n.id)
nodes(n::NodeID) = Set([n.id.id])
nodes(e::Edge) = union(map(nodes, e.nodes)...)

# generate a set of all node pairs that correspond to edges
# set of all node pairs that correspond to edges
function edges(g::Graph)
e = vcat(map(edges, g.stmts)...)
if g.directed
Expand Down

0 comments on commit 36b7d9c

Please sign in to comment.