rgl 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rgl/base.rb +1 -1
- data/lib/rgl/bidirectional_adjacency.rb +5 -3
- data/test/bidirectional_graph_test.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47e8e8f4af2accfae6599fa5d4a4a47738383132e1a4466fe08f03da6de685a5
|
4
|
+
data.tar.gz: a5f2d79f45f1ebf4dba49e1249d4ab56688d802b54eefb2b656d0190af9ab5d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 051d980a5da8369366f7aa2dcd261a28dbcc4068fa9356c3b96ec5a89ea377752a545b6a413316ffbecb0f3b851372c966bf3acbb5b615808dd818160053920a
|
7
|
+
data.tar.gz: 4fdb3d0aa88108a1fdea83cdb65ce92ea69bd6318874d5fbced1ccd64ca8ee9651c8e948fbe302725bfef00b214da2a20849aa1d5cdcff71c4d9d07adeea8104
|
data/lib/rgl/base.rb
CHANGED
@@ -22,9 +22,11 @@ module RGL
|
|
22
22
|
super(edgelist_class, *other_graphs)
|
23
23
|
end
|
24
24
|
|
25
|
-
#
|
26
|
-
|
27
|
-
|
25
|
+
# @see MutableGraph#add_vertex.
|
26
|
+
def add_vertex(v)
|
27
|
+
super(v)
|
28
|
+
@reverse.add_vertex(v)
|
29
|
+
end
|
28
30
|
|
29
31
|
# @see MutableGraph#add_edge.
|
30
32
|
def add_edge(u, v)
|
@@ -149,6 +149,9 @@ class TestBidirectionalAdjacencyGraph < Test::Unit::TestCase
|
|
149
149
|
assert_equal @out_neighbors[v], @dg.out_neighbors(v).to_set
|
150
150
|
assert_equal @in_neighbors[v], @dg.in_neighbors(v).to_set
|
151
151
|
end
|
152
|
+
@dg.add_vertex(42)
|
153
|
+
assert_empty(@dg.out_neighbors(42))
|
154
|
+
assert_empty(@dg.in_neighbors(42))
|
152
155
|
end
|
153
156
|
|
154
157
|
def test_each_neighbor
|
@@ -160,6 +163,13 @@ class TestBidirectionalAdjacencyGraph < Test::Unit::TestCase
|
|
160
163
|
@dg.each_in_neighbor(v) { |n| in_neighbors << n }
|
161
164
|
assert_equal @in_neighbors[v], in_neighbors
|
162
165
|
end
|
166
|
+
@dg.add_vertex(42)
|
167
|
+
out_neighbors = Set.new
|
168
|
+
@dg.each_out_neighbor(42) { |n| out_neighbors << n }
|
169
|
+
assert_empty(out_neighbors)
|
170
|
+
in_neighbors = Set.new
|
171
|
+
@dg.each_in_neighbor(42) { |n| in_neighbors << n }
|
172
|
+
assert_empty(in_neighbors)
|
163
173
|
end
|
164
174
|
|
165
175
|
def test_degrees
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rgl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Horst Duchene
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire: rgl/base
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-03-
|
12
|
+
date: 2023-03-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: stream
|