test/test_tools.h
changeset 1716 d8c28868f074
parent 1435 8e85e6bbefdf
child 1728 eb8bb91ba9e2
equal deleted inserted replaced
0:81ce11f3dd36 1:345b46a21ec9
   127     checkGraphInEdgeList(G, n, 3);
   127     checkGraphInEdgeList(G, n, 3);
   128     checkGraphOutEdgeList(G, n, 3);
   128     checkGraphOutEdgeList(G, n, 3);
   129   }  
   129   }  
   130 }
   130 }
   131 
   131 
   132 ///Structure returned by \ref addSymPetersen().
   132 ///Structure returned by \ref addUndirPetersen().
   133 
   133 
   134 ///Structure returned by \ref addSymPetersen().
   134 ///Structure returned by \ref addUndirPetersen().
   135 ///
   135 ///
   136 template<class Graph> struct SymPetStruct
   136 template<class Graph> struct UndirPetStruct
   137 {
   137 {
   138   ///Vector containing the outer nodes.
   138   ///Vector containing the outer nodes.
   139   std::vector<typename Graph::Node> outer;
   139   std::vector<typename Graph::Node> outer;
   140   ///Vector containing the inner nodes.
   140   ///Vector containing the inner nodes.
   141   std::vector<typename Graph::Node> inner;
   141   std::vector<typename Graph::Node> inner;
   142   ///Vector containing the edges of the inner circle.
   142   ///Vector containing the edges of the inner circle.
   143   std::vector<typename Graph::SymEdge> incir;
   143   std::vector<typename Graph::UndirEdge> incir;
   144   ///Vector containing the edges of the outer circle.
   144   ///Vector containing the edges of the outer circle.
   145   std::vector<typename Graph::SymEdge> outcir;
   145   std::vector<typename Graph::UndirEdge> outcir;
   146   ///Vector containing the chord edges.
   146   ///Vector containing the chord edges.
   147   std::vector<typename Graph::SymEdge> chords;
   147   std::vector<typename Graph::UndirEdge> chords;
   148 };
   148 };
   149 
   149 
   150 ///Adds a Petersen graph to the symmetric \c G.
   150 ///Adds a Petersen graph to the undirected \c G.
   151 
   151 
   152 ///Adds a Petersen graph to the symmetric \c G.
   152 ///Adds a Petersen graph to the undirected \c G.
   153 ///\return The nodes and edges of the generated graph.
   153 ///\return The nodes and edges of the generated graph.
   154 
   154 
   155 template<typename Graph>
   155 template<typename Graph>
   156 SymPetStruct<Graph> addSymPetersen(Graph &G,int num=5)
   156 UndirPetStruct<Graph> addUndirPetersen(Graph &G,int num=5)
   157 {
   157 {
   158   SymPetStruct<Graph> n;
   158   UndirPetStruct<Graph> n;
   159 
   159 
   160   for(int i=0;i<num;i++) {
   160   for(int i=0;i<num;i++) {
   161     n.outer.push_back(G.addNode());
   161     n.outer.push_back(G.addNode());
   162     n.inner.push_back(G.addNode());
   162     n.inner.push_back(G.addNode());
   163   }
   163   }