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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f4b3d0c46bc5145d7ff932e0166f220a1d7d8ebbcceead860f442cbfc8e4708
4
- data.tar.gz: 501fe6687c99a1d4ac7f7801640f2311baa1bda69105f712b8c01e800e0eef44
3
+ metadata.gz: 47e8e8f4af2accfae6599fa5d4a4a47738383132e1a4466fe08f03da6de685a5
4
+ data.tar.gz: a5f2d79f45f1ebf4dba49e1249d4ab56688d802b54eefb2b656d0190af9ab5d7
5
5
  SHA512:
6
- metadata.gz: c96d01848ccf3e3f285852bd4ae3f492251973d248dcb1b6a1733027b7e7dddb6e5785b84f3e6c3c9c8e6307f808929394a2001ed31f0c01d8f6b14a686cd7dc
7
- data.tar.gz: 2a44e9de16e9f0b11f03df63ad6ebf17263b5edf38af2cf2d346803895c58e8d496ede3a5a23970ab2db6030f4647a454d6f78a7854bb2dbb5b3194610762ea0
6
+ metadata.gz: 051d980a5da8369366f7aa2dcd261a28dbcc4068fa9356c3b96ec5a89ea377752a545b6a413316ffbecb0f3b851372c966bf3acbb5b615808dd818160053920a
7
+ data.tar.gz: 4fdb3d0aa88108a1fdea83cdb65ce92ea69bd6318874d5fbced1ccd64ca8ee9651c8e948fbe302725bfef00b214da2a20849aa1d5cdcff71c4d9d07adeea8104
data/lib/rgl/base.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # base.rb
2
2
 
3
3
  # version information
4
- RGL_VERSION = "0.6.1"
4
+ RGL_VERSION = "0.6.2"
5
5
 
6
6
  # Module {RGL} defines the namespace for all modules and classes of the graph
7
7
  # library. The main module is {Graph} which defines the abstract behavior of
@@ -22,9 +22,11 @@ module RGL
22
22
  super(edgelist_class, *other_graphs)
23
23
  end
24
24
 
25
- # We don't need to override add_vertex() because the reverse graph doesn't need to
26
- # contain any unconnected vertices. Vertices will be added by add_edge() as
27
- # required.
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.1
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-03 00:00:00.000000000 Z
12
+ date: 2023-03-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: stream