COIN-OR::LEMON - Graph Library

Changeset 585:65fbcf2f978a in lemon-main for test/bfs_test.cc


Ignore:
Timestamp:
04/15/09 03:26:45 (15 years ago)
Author:
Peter Kovacs <kpeter@…>
Branch:
default
Phase:
public
Message:

Improve test files for some algorithms (#263)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/bfs_test.cc

    r440 r585  
    5959
    6060  Digraph G;
    61   Node s, t;
     61  Node s, t, n;
    6262  Arc e;
    63   int l;
     63  int l, i;
    6464  bool b;
    6565  BType::DistMap d(G);
    6666  BType::PredMap p(G);
    6767  Path<Digraph> pp;
     68  concepts::ReadMap<Node,bool> nm;
    6869
    6970  {
    7071    BType bfs_test(G);
     72    const BType& const_bfs_test = bfs_test;
    7173
    7274    bfs_test.run(s);
     
    7476    bfs_test.run();
    7577
    76     l  = bfs_test.dist(t);
    77     e  = bfs_test.predArc(t);
    78     s  = bfs_test.predNode(t);
    79     b  = bfs_test.reached(t);
    80     d  = bfs_test.distMap();
    81     p  = bfs_test.predMap();
    82     pp = bfs_test.path(t);
     78    bfs_test.init();
     79    bfs_test.addSource(s);
     80    n = bfs_test.processNextNode();
     81    n = bfs_test.processNextNode(t, b);
     82    n = bfs_test.processNextNode(nm, n);
     83    n = const_bfs_test.nextNode();
     84    b = const_bfs_test.emptyQueue();
     85    i = const_bfs_test.queueSize();
     86   
     87    bfs_test.start();
     88    bfs_test.start(t);
     89    bfs_test.start(nm);
     90
     91    l  = const_bfs_test.dist(t);
     92    e  = const_bfs_test.predArc(t);
     93    s  = const_bfs_test.predNode(t);
     94    b  = const_bfs_test.reached(t);
     95    d  = const_bfs_test.distMap();
     96    p  = const_bfs_test.predMap();
     97    pp = const_bfs_test.path(t);
    8398  }
    8499  {
     
    87102      ::SetDistMap<concepts::ReadWriteMap<Node,int> >
    88103      ::SetReachedMap<concepts::ReadWriteMap<Node,bool> >
     104      ::SetStandardProcessedMap
    89105      ::SetProcessedMap<concepts::WriteMap<Node,bool> >
    90       ::SetStandardProcessedMap
    91106      ::Create bfs_test(G);
     107     
     108    concepts::ReadWriteMap<Node,Arc> pred_map;
     109    concepts::ReadWriteMap<Node,int> dist_map;
     110    concepts::ReadWriteMap<Node,bool> reached_map;
     111    concepts::WriteMap<Node,bool> processed_map;
     112   
     113    bfs_test
     114      .predMap(pred_map)
     115      .distMap(dist_map)
     116      .reachedMap(reached_map)
     117      .processedMap(processed_map);
    92118
    93119    bfs_test.run(s);
    94120    bfs_test.run(s,t);
    95121    bfs_test.run();
     122   
     123    bfs_test.init();
     124    bfs_test.addSource(s);
     125    n = bfs_test.processNextNode();
     126    n = bfs_test.processNextNode(t, b);
     127    n = bfs_test.processNextNode(nm, n);
     128    n = bfs_test.nextNode();
     129    b = bfs_test.emptyQueue();
     130    i = bfs_test.queueSize();
     131   
     132    bfs_test.start();
     133    bfs_test.start(t);
     134    bfs_test.start(nm);
    96135
    97136    l  = bfs_test.dist(t);
Note: See TracChangeset for help on using the changeset viewer.