rgl 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,8 +14,8 @@ class TestDirectedGraph < Test::Unit::TestCase
14
14
 
15
15
  def test_empty_graph
16
16
  dg = DirectedAdjacencyGraph.new
17
- assert(dg.empty?)
18
- assert(dg.directed?)
17
+ assert dg.empty?
18
+ assert dg.directed?
19
19
  assert(!dg.has_edge?(2,1))
20
20
  assert(!dg.has_vertex?(3))
21
21
  # Non existend vertex result in a Name Error because each_key is
@@ -97,4 +97,24 @@ class TestDirectedGraph < Test::Unit::TestCase
97
97
  assert_equal(dg.vertices.sort, [1,2,3,4])
98
98
  assert_equal(dg.edges.to_s, "(1-2)(3-4)")
99
99
  end
100
+
101
+ def test_reverse
102
+ reverted = @dg.reverse
103
+ @dg.each_edge do |u,v|
104
+ assert(reverted.has_edge?(v,u))
105
+ end
106
+ end
107
+
108
+ def test_reverse
109
+ # Add isolated vertex
110
+ @dg.add_vertex(42)
111
+ reverted = @dg.reverse
112
+
113
+ @dg.each_edge do |u,v|
114
+ assert(reverted.has_edge?(v,u))
115
+ end
116
+
117
+ assert(reverted.has_vertex?(42),
118
+ "Reverted graph should contain isolated Vertex 42")
119
+ end
100
120
  end
@@ -95,4 +95,8 @@ class TestUnDirectedGraph < Test::Unit::TestCase
95
95
  dg.remove_vertices 1,3,Object # ones again
96
96
  assert_equal dg.vertices.sort, [2,4]
97
97
  end
98
+
99
+ def test_reverse
100
+ assert_equal(@dg, @dg.reverse)
101
+ end
98
102
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.3
2
+ rubygems_version: 0.8.10
3
3
  specification_version: 1
4
4
  name: rgl
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.2.2
7
- date: 2004-12-12
6
+ version: 0.2.3
7
+ date: 2005-04-12
8
8
  summary: Ruby Graph Library
9
9
  require_paths:
10
10
  - lib
11
11
  email: hd.at.clr@hduchene.de
12
- homepage: rgl.rubyforge.org
12
+ homepage: http://rgl.rubyforge.org
13
13
  rubyforge_project: rgl
14
14
  description: "RGL is a framework for graph data structures and algorithms. The design of the
15
15
  library is much influenced by the Boost Graph Library (BGL) which is written in
@@ -19,7 +19,7 @@ description: "RGL is a framework for graph data structures and algorithms. The
19
19
  graphs, they are merely building blocks for constructing graph algorithms. The
20
20
  graph algorithms in RGL currently include: * Topological Sort * Connected
21
21
  Components * Strongly Connected Components * Transitive Closure"
22
- autorequire: rgl
22
+ autorequire: rgl/base
23
23
  default_executable:
24
24
  bindir: bin
25
25
  has_rdoc: true
@@ -36,7 +36,6 @@ authors:
36
36
  files:
37
37
  - install.rb
38
38
  - ChangeLog
39
- - Makefile
40
39
  - README
41
40
  - Rakefile
42
41
  - TAGS
@@ -58,7 +57,8 @@ files:
58
57
  - examples/rdep-rgl.rb
59
58
  - examples/codegraph
60
59
  - examples/graph.dot
61
- - examples/graph.png
60
+ - examples/insel.rb
61
+ - examples/debgraph.rb
62
62
  - examples/north/Graph.log
63
63
  - examples/north/g.10.0.graphml
64
64
  - examples/north/g.10.1.graphml
data/Makefile DELETED
@@ -1,72 +0,0 @@
1
- #
2
- # make test - run the tests
3
- # make clean - tidy up
4
- #
5
-
6
- LIB=./lib
7
- RGL=rgl-$(VERSION)
8
- BOOST_DOC=http://www.boost.org/libs/graph/doc
9
- #BOOST_DOC=file://D:/Programme/bgl/boost_1_25_1/libs/graph/doc
10
-
11
- default: test
12
- test:
13
- cd tests && ruby -I../lib runtests.rb
14
-
15
- # Release must have VERSION variable set
16
- #
17
- # make VERSION=0.2 release
18
- #
19
-
20
- release: doc stamp clean tar
21
-
22
- ftpput: ${RGL}.tgz
23
- ftpput.rb $<
24
-
25
- releasedoc: doc
26
- rm -f htdocs
27
- ln -fs doc htdocs
28
- tar --dereference --exclude='*.bak' -czf htdocs.tgz htdocs
29
- rm htdocs
30
- scp htdocs.tgz monora@rgl.sf.net:/home/groups/r/rg/rgl
31
-
32
- stamp:
33
- ruby -i.bak -pe 'sub!(/V\d+(\.\d+)+/, "V$(VERSION)") if /_VERSION =/' ${LIB}/rgl/base.rb
34
- rm ${LIB}/rgl/base.rb.bak
35
- cvs commit
36
- cvs rtag `echo V$(VERSION) | sed s/\\\\./_/g` rgl
37
-
38
- doc: ${LIB}/rgl/*.rb README
39
- # cd ${LIB} && rdoc --diagram --fileboxes --title RGL --main rgl/base.rb --op ../doc
40
- cd ${LIB} && rdoc.bat --title RGL --main rgl/base.rb --op ../doc
41
- cp examples/*.jpg doc
42
- find doc -name \*.html -print | xargs ruby -i.bak -pe 'sub!(/BOOST_DOC.(.*.html)/,"<a href=${BOOST_DOC}/\\1>\\1<a>")'
43
-
44
- install:
45
- ruby install.rb
46
-
47
- tags:
48
- rtags `find ${LIB} -name '*.rb'`
49
-
50
- tar: test
51
- ln -fs rgl ../${RGL}
52
- tar --directory=.. \
53
- --create \
54
- --dereference \
55
- --file=${RGL}.tgz \
56
- --gzip \
57
- --exclude='CVS' \
58
- --exclude='cvs' \
59
- --exclude='misc' \
60
- --exclude='doc' \
61
- --exclude='homepage' \
62
- --exclude='*.tgz' \
63
- --exclude='*/.*' \
64
- ${RGL}
65
- rm ../${RGL}
66
-
67
- clean:
68
- rm -rf rgl*.tgz graph.dot TAGS examples/*/*.dot
69
- find . -name \*~ -print | xargs rm -f
70
- find . -name \*.bak -print | xargs rm -f
71
- find . -name core -print | xargs rm -f
72
-
Binary file