Ver código fonte

Simplify graph definitions

Eric Ramat 9 anos atrás
pai
commit
b5f8a55bd4

+ 6 - 23
src/tests/boost_graph/graph_defs.hpp

@@ -60,34 +60,17 @@ struct EdgeProperties
     { }
 };
 
-typedef boost::adjacency_list < boost::vecS, boost::vecS,
+typedef boost::adjacency_list < boost::vecS,
+                                boost::vecS,
                                 boost::bidirectionalS,
                                 VertexProperties,
                                 EdgeProperties > OrientedGraph;
-typedef std::vector < OrientedGraph > OrientedGraphs;
 
-typedef boost::adjacency_list < boost::vecS, boost::vecS, boost::undirectedS,
+typedef boost::adjacency_list < boost::vecS,
+                                boost::vecS,
+                                boost::undirectedS,
                                 VertexProperties,
-                                EdgeProperties> UnorientedGraph;
-
-typedef std::vector < UnorientedGraph* > Base_Graph;
-
-typedef boost::graph_traits < UnorientedGraph >::vertex_descriptor vertex_t;
-typedef boost::graph_traits < UnorientedGraph >::edge_descriptor edge_t;
-
-typedef OrientedGraph::vertex_descriptor vertex_to;
-typedef OrientedGraph::edge_descriptor edge_to;
-
-typedef std::pair < int, int > Edge;
-typedef std::vector < Edge > Edges;
-typedef Edges OutputEdges;
-typedef Edges InputEdges;
-typedef std::vector < OutputEdges > OutputEdgeList;
-typedef std::vector < InputEdges > InputEdgeList;
-
-typedef std::pair < int, int > Port;
-typedef std::pair < Port, Port > Connection;
-typedef std::vector < Connection > Connections;
+                                EdgeProperties > UnorientedGraph;
 
 } } } // namespace paradevs tests boost_graph
 

+ 20 - 0
src/tests/boost_graph/partitioning/defs.hpp

@@ -34,6 +34,26 @@
 
 namespace paradevs { namespace tests { namespace boost_graph {
 
+typedef std::vector < OrientedGraph > OrientedGraphs;
+typedef std::vector < UnorientedGraph* > Base_Graph;
+
+typedef boost::graph_traits < UnorientedGraph >::vertex_descriptor vertex_t;
+typedef boost::graph_traits < UnorientedGraph >::edge_descriptor edge_t;
+
+typedef OrientedGraph::vertex_descriptor vertex_to;
+typedef OrientedGraph::edge_descriptor edge_to;
+
+typedef std::pair < int, int > Edge;
+typedef std::vector < Edge > Edges;
+typedef Edges OutputEdges;
+typedef Edges InputEdges;
+typedef std::vector < OutputEdges > OutputEdgeList;
+typedef std::vector < InputEdges > InputEdgeList;
+
+typedef std::pair < int, int > Port;
+typedef std::pair < Port, Port > Connection;
+typedef std::vector < Connection > Connections;
+
 typedef unsigned int uint;
 
 typedef std::vector < int > Entiers;

+ 5 - 3
src/tests/mpi/main.cpp

@@ -24,18 +24,20 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <tests/mpi/graph_manager.hpp>
-
 #include <paradevs/common/RootCoordinator.hpp>
-#include <paradevs/kernel/pdevs/mpi/LogicalProcessor.hpp>
 
 #include <boost/mpi/environment.hpp>
 #include <boost/mpi/communicator.hpp>
 
+#include <tests/boost_graph/graph_defs.hpp>
 #include <tests/boost_graph/graph_builder.hpp>
 #include <tests/boost_graph/graph_generator.hpp>
 #include <tests/boost_graph/graph_partitioning.hpp>
 
+#include <paradevs/common/time/DoubleTime.hpp>
+#include <paradevs/kernel/pdevs/mpi/LogicalProcessor.hpp>
+#include <tests/mpi/graph_manager.hpp>
+
 #include <chrono>
 
 using namespace paradevs::tests::mpi;

+ 6 - 23
src/tests/plot/graph_defs.hpp

@@ -61,34 +61,17 @@ struct EdgeProperties
     { }
 };
 
-typedef boost::adjacency_list < boost::vecS, boost::vecS,
+typedef boost::adjacency_list < boost::vecS,
+                                boost::vecS,
                                 boost::bidirectionalS,
                                 VertexProperties,
                                 EdgeProperties > OrientedGraph;
-typedef std::vector < OrientedGraph > OrientedGraphs;
 
-typedef boost::adjacency_list < boost::vecS, boost::vecS, boost::undirectedS,
+typedef boost::adjacency_list < boost::vecS,
+                                boost::vecS,
+                                boost::undirectedS,
                                 VertexProperties,
-                                EdgeProperties> UnorientedGraph;
-
-typedef std::vector < UnorientedGraph* > Base_Graph;
-
-typedef boost::graph_traits < UnorientedGraph >::vertex_descriptor vertex_t;
-typedef boost::graph_traits < UnorientedGraph >::edge_descriptor edge_t;
-
-typedef OrientedGraph::vertex_descriptor vertex_to;
-typedef OrientedGraph::edge_descriptor edge_to;
-
-typedef std::pair < int, int > Edge;
-typedef std::vector < Edge > Edges;
-typedef Edges OutputEdges;
-typedef Edges InputEdges;
-typedef std::vector < OutputEdges > OutputEdgeList;
-typedef std::vector < InputEdges > InputEdgeList;
-
-typedef std::pair < int, int > Port;
-typedef std::pair < Port, Port > Connection;
-typedef std::vector < Connection > Connections;
+                                EdgeProperties > UnorientedGraph;
 
 } } } // namespace paradevs tests boost_graph