COIN-OR::LEMON - Graph Library

Changeset 1909:2d806130e700 in lemon-0.x for test


Ignore:
Timestamp:
01/26/06 16:42:13 (18 years ago)
Author:
Mihaly Barasz
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2484
Message:

Undir -> U transition

Location:
test
Files:
5 edited
1 moved

Legend:

Unmodified
Added
Removed
  • test/Makefile.am

    r1901 r1909  
    3434        time_measure_test \
    3535        unionfind_test \
    36         undir_graph_test \
     36        ugraph_test \
    3737        xy_test \
    3838        heap_test
     
    7171unionfind_test_SOURCES = unionfind_test.cc
    7272xy_test_SOURCES = xy_test.cc
    73 undir_graph_test_SOURCES = undir_graph_test.cc
     73ugraph_test_SOURCES = ugraph_test.cc
    7474heap_test_SOURCES = heap_test.cc
    7575
  • test/graph_adaptor_test.cc

    r1875 r1909  
    2020#include<lemon/smart_graph.h>
    2121#include<lemon/concept/graph.h>
    22 #include<lemon/concept/undir_graph.h>
     22#include<lemon/concept/ugraph.h>
    2323
    2424#include<lemon/list_graph.h>
     
    6666
    6767    /// \bug why does not compile with StaticGraph
    68     checkConcept<BaseIterableUndirGraphConcept, UndirGraphAdaptor<ListGraph> >();
    69     checkConcept<IterableUndirGraphConcept, UndirGraphAdaptor<ListGraph> >();
    70     checkConcept<MappableUndirGraphConcept, UndirGraphAdaptor<ListGraph> >();
     68    checkConcept<BaseIterableUGraphConcept, UGraphAdaptor<ListGraph> >();
     69    checkConcept<IterableUGraphConcept, UGraphAdaptor<ListGraph> >();
     70    checkConcept<MappableUGraphConcept, UGraphAdaptor<ListGraph> >();
    7171  }
    7272  std::cout << __FILE__ ": All tests passed.\n";
  • test/max_matching_test.cc

    r1875 r1909  
    3232int main() {
    3333
    34   typedef UndirListGraph Graph;
     34  typedef ListUGraph Graph;
    3535
    3636  typedef Graph::Edge Edge;
    37   typedef Graph::UndirEdgeIt UndirEdgeIt;
     37  typedef Graph::UEdgeIt UEdgeIt;
    3838  typedef Graph::IncEdgeIt IncEdgeIt;
    3939  typedef Graph::NodeIt NodeIt;
     
    139139
    140140  bool noedge=true;
    141   for(UndirEdgeIt e(g); e!=INVALID; ++e) {
     141  for(UEdgeIt e(g); e!=INVALID; ++e) {
    142142   if ( (pos[g.target(e)]==max_matching.C && pos[g.source(e)]==max_matching.D) ||
    143143         (pos[g.target(e)]==max_matching.D && pos[g.source(e)]==max_matching.C) )
  • test/path_test.cc

    r1875 r1909  
    9090template void checkCompilePath< concept::Path<ListGraph> >(concept::Path<ListGraph> &);
    9191template void checkCompilePath< DirPath<ListGraph> >(DirPath<ListGraph> &);
    92 template void checkCompilePath< UndirPath<ListGraph> >(UndirPath<ListGraph> &);
     92template void checkCompilePath< UPath<ListGraph> >(UPath<ListGraph> &);
    9393
    9494int main()
  • test/test_tools.h

    r1875 r1909  
    134134}
    135135
    136 ///Structure returned by \ref addUndirPetersen().
     136///Structure returned by \ref addUPetersen().
    137137
    138 ///Structure returned by \ref addUndirPetersen().
     138///Structure returned by \ref addUPetersen().
    139139///
    140 template<class Graph> struct UndirPetStruct
     140template<class Graph> struct UPetStruct
    141141{
    142142  ///Vector containing the outer nodes.
     
    145145  std::vector<typename Graph::Node> inner;
    146146  ///Vector containing the edges of the inner circle.
    147   std::vector<typename Graph::UndirEdge> incir;
     147  std::vector<typename Graph::UEdge> incir;
    148148  ///Vector containing the edges of the outer circle.
    149   std::vector<typename Graph::UndirEdge> outcir;
     149  std::vector<typename Graph::UEdge> outcir;
    150150  ///Vector containing the chord edges.
    151   std::vector<typename Graph::UndirEdge> chords;
     151  std::vector<typename Graph::UEdge> chords;
    152152};
    153153
     
    158158
    159159template<typename Graph>
    160 UndirPetStruct<Graph> addUndirPetersen(Graph &G,int num=5)
     160UPetStruct<Graph> addUPetersen(Graph &G,int num=5)
    161161{
    162   UndirPetStruct<Graph> n;
     162  UPetStruct<Graph> n;
    163163
    164164  for(int i=0;i<num;i++) {
  • test/ugraph_test.cc

    r1795 r1909  
    22
    33#include <lemon/bits/graph_extender.h>
    4 #include <lemon/concept/undir_graph.h>
     4#include <lemon/concept/ugraph.h>
    55#include <lemon/list_graph.h>
    66#include <lemon/smart_graph.h>
     
    1717
    1818void check_concepts() {
    19   typedef UndirGraphExtender<ListGraphBase> UndirListGraphBase;
    20 
    21   typedef IterableUndirGraphExtender<
    22     AlterableUndirGraphExtender<UndirListGraphBase> > IterableUndirListGraph;
    23 
    24   typedef MappableUndirGraphExtender<IterableUndirListGraph>
    25     MappableUndirListGraph;
    26 
    27   typedef ErasableUndirGraphExtender<
    28     ClearableUndirGraphExtender<
    29     ExtendableUndirGraphExtender<MappableUndirListGraph> > > Graph;
    30 
    31   checkConcept<BaseIterableUndirGraphConcept, Graph>();
    32   checkConcept<IterableUndirGraphConcept, Graph>();
    33   checkConcept<MappableUndirGraphConcept, Graph>();
    34 
    35   checkConcept<UndirGraph, Graph>();
    36   checkConcept<ErasableUndirGraph, Graph>();
    37 
    38   checkConcept<UndirGraph, UndirListGraph>();
    39   checkConcept<ErasableUndirGraph, UndirListGraph>();
    40 
    41   checkConcept<UndirGraph, UndirSmartGraph>();
    42   checkConcept<ExtendableUndirGraph, UndirSmartGraph>();
    43 
    44   checkConcept<UndirGraph, UndirFullGraph>();
    45 
    46   checkConcept<UndirGraph, UndirGraph>();
    47 
    48   checkConcept<UndirGraph, GridGraph>();
     19  typedef UGraphExtender<ListGraphBase> ListUGraphBase;
     20
     21  typedef IterableUGraphExtender<
     22    AlterableUGraphExtender<ListUGraphBase> > IterableListUGraph;
     23
     24  typedef MappableUGraphExtender<IterableListUGraph>
     25    MappableListUGraph;
     26
     27  typedef ErasableUGraphExtender<
     28    ClearableUGraphExtender<
     29    ExtendableUGraphExtender<MappableListUGraph> > > Graph;
     30
     31  checkConcept<BaseIterableUGraphConcept, Graph>();
     32  checkConcept<IterableUGraphConcept, Graph>();
     33  checkConcept<MappableUGraphConcept, Graph>();
     34
     35  checkConcept<UGraph, Graph>();
     36  checkConcept<ErasableUGraph, Graph>();
     37
     38  checkConcept<UGraph, ListUGraph>();
     39  checkConcept<ErasableUGraph, ListUGraph>();
     40
     41  checkConcept<UGraph, SmartUGraph>();
     42  checkConcept<ExtendableUGraph, SmartUGraph>();
     43
     44  checkConcept<UGraph, FullUGraph>();
     45
     46  checkConcept<UGraph, UGraph>();
     47
     48  checkConcept<UGraph, GridGraph>();
    4949}
    5050
     
    6868
    6969  int uee = 0;
    70   for (typename Graph::UndirEdgeIt it(g); it != INVALID; ++it) {
     70  for (typename Graph::UEdgeIt it(g); it != INVALID; ++it) {
    7171    ++uee;
    7272  }
    7373
    74   check(uee == e, "Wrong undir edge number.");
    75   check(countUndirEdges(g) == e, "Wrong undir edge number.");
     74  check(uee == e, "Wrong uedge number.");
     75  check(countUEdges(g) == e, "Wrong uedge number.");
    7676}
    7777
     
    8080
    8181  typedef typename Graph::NodeIt NodeIt;
    82   typedef typename Graph::UndirEdgeIt UEdgeIt;
     82  typedef typename Graph::UEdgeIt UEdgeIt;
    8383  typedef typename Graph::EdgeIt EdgeIt;
    8484
     
    8989  }
    9090
    91   std::cout << "UndirEdge" << std::endl;
     91  std::cout << "UEdge" << std::endl;
    9292  i=0;
    9393  for(UEdgeIt it(g); it!=INVALID; ++it, ++i) {
     
    111111
    112112  typedef typename Graph::Node Node;
    113   typedef typename Graph::UndirEdge UEdge;
     113  typedef typename Graph::UEdge UEdge;
    114114  typedef typename Graph::Edge Edge;
    115115  typedef typename Graph::NodeIt NodeIt;
    116   typedef typename Graph::UndirEdgeIt UEdgeIt;
     116  typedef typename Graph::UEdgeIt UEdgeIt;
    117117  typedef typename Graph::EdgeIt EdgeIt;
    118118
     
    182182  check_concepts();
    183183
    184   check_graph<UndirListGraph>();
    185   check_graph<UndirSmartGraph>();
     184  check_graph<ListUGraph>();
     185  check_graph<SmartUGraph>();
    186186
    187187  {
    188     UndirFullGraph g(5);
     188    FullUGraph g(5);
    189189    check_item_counts(g, 5, 10);
    190190  }
Note: See TracChangeset for help on using the changeset viewer.