<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -79,6 +79,26 @@ VALUE graph_each_vertex(VALUE self)
     return self;
 }
 
+/* call-seq:
+ *    graph.size =&gt; vertex_count
+ *
+ * Returns the number of vertices in +graph+
+ */
+static
+VALUE graph_size(VALUE self)
+{
+    RubyGraph&amp; graph = graph_wrapped(self);
+
+    vertex_iterator begin, end;
+    tie(begin, end) = vertices(graph);
+
+    size_t count = 0;
+    for (vertex_iterator it = begin; it != end; ++it)
+	++count;
+    return UINT2NUM(count);
+}
+
+
 /*
  * call-seq:
  *  graph.insert(vertex)		    =&gt; graph
@@ -500,6 +520,7 @@ extern &quot;C&quot; void Init_roby_bgl()
     rb_define_alloc_func(bglGraph, graph_alloc);
 
     // Functions to manipulate BGL::Vertex objects in Graphs
+    rb_define_method(bglGraph, &quot;size&quot;,    RUBY_METHOD_FUNC(graph_size), 0);
     rb_define_method(bglGraph, &quot;insert&quot;,    RUBY_METHOD_FUNC(graph_insert), 1);
     rb_define_method(bglGraph, &quot;remove&quot;,    RUBY_METHOD_FUNC(graph_remove), 1);
     rb_define_method(bglGraph, &quot;include?&quot;,  RUBY_METHOD_FUNC(graph_include_p), 1);</diff>
      <filename>ext/graph/graph.cc</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2f7fe9afed41cb21d7736e843230c8816e8c0605</id>
    </parent>
  </parents>
  <author>
    <name>Sylvain Joyeux</name>
    <email>sylvain.joyeux@m4x.org</email>
  </author>
  <url>http://github.com/doudou/roby/commit/4776933709160b138d1b1859f25a15144544a867</url>
  <id>4776933709160b138d1b1859f25a15144544a867</id>
  <committed-date>2008-06-01T13:26:53-07:00</committed-date>
  <authored-date>2008-06-01T13:26:53-07:00</authored-date>
  <message>[bgl] define Graph#size</message>
  <tree>50d75a798eaa17a72dc4e12125085a03351e492c</tree>
  <committer>
    <name>Sylvain Joyeux</name>
    <email>sylvain.joyeux@m4x.org</email>
  </committer>
</commit>
