COIN-OR::LEMON - Graph Library

Changeset 286:da414906fe21 in lemon for test/dfs_test.cc


Ignore:
Timestamp:
09/26/08 12:40:11 (11 years ago)
Author:
Peter Kovacs <kpeter@…>
Branch:
default
Phase:
public
Message:

Improvements related to BFS/DFS/Dijkstra (ticket #96)

  • Add run(s,t) function to BfsVisit?.
  • Modify run(s,t) functions in the class interfaces to return bool value.
  • Bug fix in Dijkstra::start(t) function.
  • Improve Dijkstra::currentDist().
  • Extend test files to check named class template parameters.
  • Doc improvements.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/dfs_test.cc

    r278 r286  
    5757  typedef concepts::Digraph Digraph;
    5858  typedef Dfs<Digraph> DType;
     59  typedef Digraph::Node Node;
     60  typedef Digraph::Arc Arc;
    5961
    6062  Digraph G;
    61   Digraph::Node n;
    62   Digraph::Arc e;
     63  Node s, t;
     64  Arc e;
    6365  int l;
    6466  bool b;
    6567  DType::DistMap d(G);
    6668  DType::PredMap p(G);
     69  Path<Digraph> pp;
    6770
    68   DType dfs_test(G);
     71  {
     72    DType dfs_test(G);
    6973
    70   dfs_test.run(n);
     74    dfs_test.run(s);
     75    dfs_test.run(s,t);
     76    dfs_test.run();
    7177
    72   l  = dfs_test.dist(n);
    73   e  = dfs_test.predArc(n);
    74   n  = dfs_test.predNode(n);
    75   d  = dfs_test.distMap();
    76   p  = dfs_test.predMap();
    77   b  = dfs_test.reached(n);
     78    l  = dfs_test.dist(t);
     79    e  = dfs_test.predArc(t);
     80    s  = dfs_test.predNode(t);
     81    b  = dfs_test.reached(t);
     82    d  = dfs_test.distMap();
     83    p  = dfs_test.predMap();
     84    pp = dfs_test.path(t);
     85  }
     86  {
     87    DType
     88      ::SetPredMap<concepts::ReadWriteMap<Node,Arc> >
     89      ::SetDistMap<concepts::ReadWriteMap<Node,int> >
     90      ::SetReachedMap<concepts::ReadWriteMap<Node,bool> >
     91      ::SetProcessedMap<concepts::WriteMap<Node,bool> >
     92      ::SetStandardProcessedMap
     93      ::Create dfs_test(G);
    7894
    79   Path<Digraph> pp = dfs_test.path(n);
     95    dfs_test.run(s);
     96    dfs_test.run(s,t);
     97    dfs_test.run();
     98
     99    l  = dfs_test.dist(t);
     100    e  = dfs_test.predArc(t);
     101    s  = dfs_test.predNode(t);
     102    b  = dfs_test.reached(t);
     103    pp = dfs_test.path(t);
     104  }
    80105}
    81106
Note: See TracChangeset for help on using the changeset viewer.