test/dijkstra_test.cc
changeset 286 da414906fe21
parent 278 931190050520
child 293 47fbc814aa31
     1.1 --- a/test/dijkstra_test.cc	Tue Sep 23 18:42:49 2008 +0200
     1.2 +++ b/test/dijkstra_test.cc	Fri Sep 26 12:40:11 2008 +0200
     1.3 @@ -22,6 +22,7 @@
     1.4  #include <lemon/lgf_reader.h>
     1.5  #include <lemon/dijkstra.h>
     1.6  #include <lemon/path.h>
     1.7 +#include <lemon/bin_heap.h>
     1.8  
     1.9  #include "graph_test.h"
    1.10  #include "test_tools.h"
    1.11 @@ -55,28 +56,54 @@
    1.12    typedef concepts::Digraph Digraph;
    1.13    typedef concepts::ReadMap<Digraph::Arc,VType> LengthMap;
    1.14    typedef Dijkstra<Digraph, LengthMap> DType;
    1.15 +  typedef Digraph::Node Node;
    1.16 +  typedef Digraph::Arc Arc;
    1.17  
    1.18    Digraph G;
    1.19 -  Digraph::Node n;
    1.20 -  Digraph::Arc e;
    1.21 +  Node s, t;
    1.22 +  Arc e;
    1.23    VType l;
    1.24    bool b;
    1.25    DType::DistMap d(G);
    1.26    DType::PredMap p(G);
    1.27    LengthMap length;
    1.28 +  Path<Digraph> pp;
    1.29  
    1.30 -  DType dijkstra_test(G,length);
    1.31 +  {
    1.32 +    DType dijkstra_test(G,length);
    1.33  
    1.34 -  dijkstra_test.run(n);
    1.35 +    dijkstra_test.run(s);
    1.36 +    dijkstra_test.run(s,t);
    1.37  
    1.38 -  l  = dijkstra_test.dist(n);
    1.39 -  e  = dijkstra_test.predArc(n);
    1.40 -  n  = dijkstra_test.predNode(n);
    1.41 -  d  = dijkstra_test.distMap();
    1.42 -  p  = dijkstra_test.predMap();
    1.43 -  b  = dijkstra_test.reached(n);
    1.44 +    l  = dijkstra_test.dist(t);
    1.45 +    e  = dijkstra_test.predArc(t);
    1.46 +    s  = dijkstra_test.predNode(t);
    1.47 +    b  = dijkstra_test.reached(t);
    1.48 +    d  = dijkstra_test.distMap();
    1.49 +    p  = dijkstra_test.predMap();
    1.50 +    pp = dijkstra_test.path(t);
    1.51 +  }
    1.52 +  {
    1.53 +    DType
    1.54 +      ::SetPredMap<concepts::ReadWriteMap<Node,Arc> >
    1.55 +      ::SetDistMap<concepts::ReadWriteMap<Node,VType> >
    1.56 +      ::SetProcessedMap<concepts::WriteMap<Node,bool> >
    1.57 +      ::SetStandardProcessedMap
    1.58 +      ::SetOperationTraits<DijkstraWidestPathOperationTraits<VType> >
    1.59 +      ::SetHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> > >
    1.60 +      ::SetStandardHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> > >
    1.61 +      ::Create dijkstra_test(G,length);
    1.62  
    1.63 -  Path<Digraph> pp = dijkstra_test.path(n);
    1.64 +    dijkstra_test.run(s);
    1.65 +    dijkstra_test.run(s,t);
    1.66 +
    1.67 +    l  = dijkstra_test.dist(t);
    1.68 +    e  = dijkstra_test.predArc(t);
    1.69 +    s  = dijkstra_test.predNode(t);
    1.70 +    b  = dijkstra_test.reached(t);
    1.71 +    pp = dijkstra_test.path(t);
    1.72 +  }
    1.73 +
    1.74  }
    1.75  
    1.76  void checkDijkstraFunctionCompile()