diff c/Motion.cpp @ 189:1116f0a1ff31

work on connected components (does not compile)
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Fri, 02 Dec 2011 19:11:53 -0500
parents 1435965d8181
children 36968a63efe1
line wrap: on
line diff
--- a/c/Motion.cpp	Thu Dec 01 19:18:32 2011 -0500
+++ b/c/Motion.cpp	Fri Dec 02 19:11:53 2011 -0500
@@ -159,22 +159,22 @@
 	UndirectedGraph::edge_descriptor e;
 	bool unused;
 	tie(e, unused) = add_edge(newVertex, *vi, graph);
-	// no need to add measures to graph[e]
+	// no need to add measures to graph[e] (edge properties)
       }
     }
   }
 }
 
 void FeatureGraph::connectedComponents(const int& lastInstant) {
-  vector<int> component(num_vertices(graph));
-  // int num = connected_components(graph, &component[0]);
-  // todo change the type of the component map http://www.boost.org/doc/libs/1_48_0/libs/graph/doc/connected_components.html
-
+  typedef boost::graph_traits<UndirectedGraph>::vertices_size_type vertices_size_type;
+  vector<vertices_size_type> components(num_vertices(graph));
+  // int num = connected_components(graph, &components[0]);
+  // // todo change the type of the component map http://www.boost.org/doc/libs/1_48_0/libs/graph/doc/connected_components.html
   // cout << "Total number of components: " << num << endl;
 
-  for (unsigned int i = 0; i < component.size(); ++i)
-      cout << "Vertex " << i <<" is in component " << component[i] << endl;
-  cout << endl;
+  // for (unsigned int i = 0; i < components.size(); ++i)
+  //     cout << "Vertex " << i <<" is in component " << components[i] << endl;
+  // cout << endl;
 }
 
 string FeatureGraph::informationString(void) {