graph :: MutableDigraph :: add_vertex
u
to this graph.If u
already belongs to the graph, then nothing happens.
var g = new HashDigraph[Int]
g.add_vertex(0)
assert g.has_vertex(0)
assert not g.has_vertex(1)
g.add_vertex(1)
assert g.num_vertices == 2
# Adds the vertex `u` to this graph.
#
# If `u` already belongs to the graph, then nothing happens.
#
# ~~~
# var g = new HashDigraph[Int]
# g.add_vertex(0)
# assert g.has_vertex(0)
# assert not g.has_vertex(1)
# g.add_vertex(1)
# assert g.num_vertices == 2
# ~~~
fun add_vertex(u: V) is abstract
lib/graph/digraph.nit:720,2--732,33
redef fun add_vertex(u)
do
if not has_vertex(u) then
incoming_vertices_map[u] = new Array[V]
outgoing_vertices_map[u] = new Array[V]
end
end
lib/graph/digraph.nit:953,2--959,4