Parcourir la source

Fix: wrong dynamics type

Christopher Herbez il y a 11 ans
Parent
commit
5a86f8e702

+ 31 - 31
src/tests/boost_graph/graph_builder.hpp

@@ -56,34 +56,34 @@ public:
         OrientedGraph::vertex_descriptor v10 = boost::add_vertex(graph);
 
         boost::add_edge(v1, v0, 1., graph);
-	boost::add_edge(v2, v0, 1., graph);
-	boost::add_edge(v3, v0, 1., graph);
-	boost::add_edge(v2, v1, 1., graph);
-	boost::add_edge(v4, v1, 1., graph);
-	boost::add_edge(v5, v1, 1., graph);
-	boost::add_edge(v6, v1, 1., graph);
-	boost::add_edge(v6, v2, 1., graph);
-	boost::add_edge(v3, v2, 1., graph);
-	boost::add_edge(v9, v3, 1., graph);
-	boost::add_edge(v10, v3 , 1., graph);
-	boost::add_edge(v5, v4, 1., graph);
-	boost::add_edge(v6, v5, 1., graph);
-	boost::add_edge(v7, v4, 1., graph);
-	boost::add_edge(v8, v4, 1., graph);
-	boost::add_edge(v8, v7, 1., graph);
-	boost::add_edge(v10, v9 , 1., graph);
-
-        graph[v6] = VertexProperties(6, 1., TOP_PIXEL);
-        graph[v8] = VertexProperties(8, 1., TOP_PIXEL);
-        graph[v10] = VertexProperties(10, 1., TOP_PIXEL);
+        boost::add_edge(v2, v0, 1., graph);
+        boost::add_edge(v3, v0, 1., graph);
+        boost::add_edge(v1, v2, 1., graph);
+        boost::add_edge(v4, v1, 1., graph);
+        boost::add_edge(v5, v1, 1., graph);
+        boost::add_edge(v6, v1, 1., graph);
+        boost::add_edge(v6, v2, 1., graph);
+        boost::add_edge(v2, v3, 1., graph);
+        boost::add_edge(v9, v3, 1., graph);
+        boost::add_edge(v10, v3 , 1., graph);
+        boost::add_edge(v4, v5, 1., graph);
+        boost::add_edge(v5, v6, 1., graph);
+        boost::add_edge(v7, v4, 1., graph);
+        boost::add_edge(v8, v4, 1., graph);
+        boost::add_edge(v7, v8, 1., graph);
+        boost::add_edge(v9, v10 , 1., graph);
+
+        graph[v6] = VertexProperties(6, 1., NORMAL_PIXEL);
+        graph[v8] = VertexProperties(8, 1., NORMAL_PIXEL);
+        graph[v10] = VertexProperties(10, 1., NORMAL_PIXEL);
         graph[v0] = VertexProperties(0, 1., NORMAL_PIXEL);
         graph[v1] = VertexProperties(1, 1., NORMAL_PIXEL);
         graph[v2] = VertexProperties(2, 1., NORMAL_PIXEL);
         graph[v3] = VertexProperties(3, 1., NORMAL_PIXEL);
         graph[v4] = VertexProperties(4, 1., NORMAL_PIXEL);
         graph[v5] = VertexProperties(5, 1., NORMAL_PIXEL);
-        graph[v7] = VertexProperties(7, 1., NORMAL_PIXEL);
-        graph[v9] = VertexProperties(9, 1., NORMAL_PIXEL);
+        graph[v7] = VertexProperties(7, 1., TOP_PIXEL);
+        graph[v9] = VertexProperties(9, 1., TOP_PIXEL);
 
         graphs.push_back(graph);
     }
@@ -110,16 +110,16 @@ public:
             OrientedGraph::vertex_descriptor v7 = boost::add_vertex(graph);
             OrientedGraph::vertex_descriptor v8 = boost::add_vertex(graph);
 
-            boost::add_edge(v2, v1, 1., graph);
+            boost::add_edge(v1, v2, 1., graph);
             boost::add_edge(v4, v1, 1., graph);
             boost::add_edge(v5, v1, 1., graph);
             boost::add_edge(v6, v1, 1., graph);
             boost::add_edge(v6, v2, 1., graph);
-            boost::add_edge(v5, v4, 1., graph);
-            boost::add_edge(v6, v5, 1., graph);
+            boost::add_edge(v4, v5, 1., graph);
+            boost::add_edge(v5, v6, 1., graph);
             boost::add_edge(v7, v4, 1., graph);
             boost::add_edge(v8, v4, 1., graph);
-            boost::add_edge(v8, v7, 1., graph);
+            boost::add_edge(v7, v8, 1., graph);
 
             graph[v6] = VertexProperties(6, 1., TOP_PIXEL);
             graph[v8] = VertexProperties(8, 1., TOP_PIXEL);
@@ -142,7 +142,7 @@ public:
 
             boost::add_edge(v3, v0, 1., graph);
             boost::add_edge(v10, v3, 1., graph);
-            boost::add_edge(v10, v9, 1., graph);
+            boost::add_edge(v9, v10, 1., graph);
             boost::add_edge(v9, v3, 1., graph);
 
             graph[v10] = VertexProperties(10, 1., TOP_PIXEL);
@@ -154,25 +154,25 @@ public:
         }
         {
             // input S1
-            input_edges.push_back(InputEdges());
-            input_edges[0].push_back(Edge(3, 2));
+        	input_edges.push_back(InputEdges());
             // input S2
             input_edges.push_back(InputEdges());
             input_edges[1].push_back(Edge(1, 0));
             input_edges[1].push_back(Edge(2, 0));
+            input_edges[1].push_back(Edge(2, 3));
 
             // output S1
             output_edges.push_back(OutputEdges());
             output_edges[0].push_back(Edge(1, 0));
             output_edges[0].push_back(Edge(2, 0));
+            output_edges[0].push_back(Edge(2, 3));
             // output S2
             output_edges.push_back(OutputEdges());
-            output_edges[1].push_back(Edge(3, 2));
 
             // parent
             parent_connections.push_back(Connection(Port(1,1),Port(2,0)));
             parent_connections.push_back(Connection(Port(1,2),Port(2,0)));
-            parent_connections.push_back(Connection(Port(2,3),Port(1,2)));
+            parent_connections.push_back(Connection(Port(1,2),Port(2,3)));
         }
     }
 };

+ 1 - 1
src/tests/boost_graph/graph_partitioning.hpp

@@ -44,7 +44,7 @@ public:
                OutputEdgeList& output_edges,
                Connections& parent_connections)
     {
-        srand(7266);
+        srand(time(NULL));
 
         UnorientedGraph* g = new UnorientedGraph();
         OrientedGraph* go = new OrientedGraph();

+ 0 - 74
src/tests/boost_graph/partitioning/graph_build.cpp

@@ -122,80 +122,6 @@ void build_graph(UnorientedGraph& ug, OrientedGraph& og)
     ug[v71] = VertexProperties(70, 1, NORMAL_PIXEL);
     ug[v91] = VertexProperties(90, 1.5, NORMAL_PIXEL);
 
-    /* property_map<UnorientedGraph,vertex_degree_t>::type
-     * poids_sommets=get(vertex_degree_t(),*g);
-
-     add_edge(0,1,1,*g);
-     add_edge(0,2,1,*g);
-     add_edge(0,3,1,*g);
-     add_edge(1,2,1,*g);
-     add_edge(1,4,1,*g);
-     add_edge(1,5,1,*g);
-     add_edge(1,6,1,*g);
-     add_edge(2,6,1,*g);
-     add_edge(2,3,1,*g);
-     add_edge(3,18,1,*g);
-     add_edge(3,21,1,*g);
-     add_edge(4,5,1,*g);
-     add_edge(4,7,1,*g);
-     add_edge(4,8,1,*g);
-     add_edge(4,9,1,*g);
-     add_edge(5,6,1,*g);
-     add_edge(6,15,1,*g);
-     add_edge(6,16,1,*g);
-     add_edge(6,17,1,*g);
-     add_edge(7,8,1,*g);
-     add_edge(7,10,1,*g);
-     add_edge(7,11,1,*g);
-     add_edge(8,9,1,*g);
-     add_edge(8,11,1,*g);
-     add_edge(8,12,1,*g);
-     add_edge(9,13,1,*g);
-     add_edge(9,14,1,*g);
-     add_edge(10,11,1,*g);
-     add_edge(11,12,1,*g);
-     add_edge(13,14,1,*g);
-     add_edge(15,16,1,*g);
-     add_edge(16,17,1,*g);
-     add_edge(17,19,1,*g);
-     add_edge(19,20,1,*g);
-     add_edge(22,23,1,*g);
-     add_edge(18,17,1,*g);
-     add_edge(18,19,1,*g);
-     add_edge(18,20,1,*g);
-     add_edge(18,21,1,*g);
-     add_edge(21,22,1,*g);
-     add_edge(21,23,1,*g);
-
-     put(poids_sommets,0,3);
-
-     for(int i=1;i<4;i++)
-     put(poids_sommets,i,2.5);
-     for(int i=4;i<7;i++)
-     put(poids_sommets,i,2);
-     put(poids_sommets,18,2);
-     put(poids_sommets,21,2);
-     for(int i=7;i<10;i++)
-     put(poids_sommets,i,1.5);
-     for(int i=15;i<18;i++)
-     put(poids_sommets,i,1.5);
-     put(poids_sommets,19,1.5);
-     put(poids_sommets,20,1.5);
-     put(poids_sommets,22,1.5);
-     put(poids_sommets,23,1.5);
-     for(int i=10;i<15;i++)
-     put(poids_sommets,i,1);
-
-     tie(vertexIt, vertexEnd) = vertices(*g);
-     for (; vertexIt != vertexEnd; ++vertexIt)
-     {
-     std::cout << *vertexIt << " est connecté avec ";
-     tie(neighbourIt, neighbourEnd) = adjacent_vertices(*vertexIt, *g);
-     for (; neighbourIt != neighbourEnd; ++neighbourIt)
-     std::cout << *neighbourIt << " ";
-     std::cout<<" et son poids est de "<< poids_sommets[*vertexIt];
-     std::cout << "\n";
-     }*/
 }
 
 } } } // namespace paradevs tests boost_graph