test/dijkstra_test.cc
branch1.2
changeset 1075 ece3d43d7e72
parent 632 65fbcf2f978a
child 1173 d216e1c8b3fa
equal deleted inserted replaced
11:eb3a50d37db8 12:e92b52cda573
     1 /* -*- mode: C++; indent-tabs-mode: nil; -*-
     1 /* -*- mode: C++; indent-tabs-mode: nil; -*-
     2  *
     2  *
     3  * This file is a part of LEMON, a generic C++ optimization library.
     3  * This file is a part of LEMON, a generic C++ optimization library.
     4  *
     4  *
     5  * Copyright (C) 2003-2009
     5  * Copyright (C) 2003-2010
     6  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     6  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     7  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     7  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     8  *
     8  *
     9  * Permission to use, modify and distribute this software is granted
     9  * Permission to use, modify and distribute this software is granted
    10  * provided that this copyright notice appears in all copies. For
    10  * provided that this copyright notice appears in all copies. For
    83     dijkstra_test.addSource(s, 1);
    83     dijkstra_test.addSource(s, 1);
    84     n = dijkstra_test.processNextNode();
    84     n = dijkstra_test.processNextNode();
    85     n = const_dijkstra_test.nextNode();
    85     n = const_dijkstra_test.nextNode();
    86     b = const_dijkstra_test.emptyQueue();
    86     b = const_dijkstra_test.emptyQueue();
    87     i = const_dijkstra_test.queueSize();
    87     i = const_dijkstra_test.queueSize();
    88     
    88 
    89     dijkstra_test.start();
    89     dijkstra_test.start();
    90     dijkstra_test.start(t);
    90     dijkstra_test.start(t);
    91     dijkstra_test.start(nm);
    91     dijkstra_test.start(nm);
    92 
    92 
    93     l  = const_dijkstra_test.dist(t);
    93     l  = const_dijkstra_test.dist(t);
   107       ::SetStandardProcessedMap
   107       ::SetStandardProcessedMap
   108       ::SetProcessedMap<concepts::WriteMap<Node,bool> >
   108       ::SetProcessedMap<concepts::WriteMap<Node,bool> >
   109       ::SetOperationTraits<DijkstraDefaultOperationTraits<VType> >
   109       ::SetOperationTraits<DijkstraDefaultOperationTraits<VType> >
   110       ::SetHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> > >
   110       ::SetHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> > >
   111       ::SetStandardHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> > >
   111       ::SetStandardHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> > >
   112       ::SetHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> >, 
   112       ::SetHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> >,
   113                 concepts::ReadWriteMap<Node,int> >
   113                 concepts::ReadWriteMap<Node,int> >
   114       ::Create dijkstra_test(G,length);
   114       ::Create dijkstra_test(G,length);
   115 
   115 
   116     LengthMap length_map;
   116     LengthMap length_map;
   117     concepts::ReadWriteMap<Node,Arc> pred_map;
   117     concepts::ReadWriteMap<Node,Arc> pred_map;
   118     concepts::ReadWriteMap<Node,VType> dist_map;
   118     concepts::ReadWriteMap<Node,VType> dist_map;
   119     concepts::WriteMap<Node,bool> processed_map;
   119     concepts::WriteMap<Node,bool> processed_map;
   120     concepts::ReadWriteMap<Node,int> heap_cross_ref;
   120     concepts::ReadWriteMap<Node,int> heap_cross_ref;
   121     BinHeap<VType, concepts::ReadWriteMap<Node,int> > heap(heap_cross_ref);
   121     BinHeap<VType, concepts::ReadWriteMap<Node,int> > heap(heap_cross_ref);
   122     
   122 
   123     dijkstra_test
   123     dijkstra_test
   124       .lengthMap(length_map)
   124       .lengthMap(length_map)
   125       .predMap(pred_map)
   125       .predMap(pred_map)
   126       .distMap(dist_map)
   126       .distMap(dist_map)
   127       .processedMap(processed_map)
   127       .processedMap(processed_map)
   134     dijkstra_test.addSource(s, 1);
   134     dijkstra_test.addSource(s, 1);
   135     n = dijkstra_test.processNextNode();
   135     n = dijkstra_test.processNextNode();
   136     n = dijkstra_test.nextNode();
   136     n = dijkstra_test.nextNode();
   137     b = dijkstra_test.emptyQueue();
   137     b = dijkstra_test.emptyQueue();
   138     i = dijkstra_test.queueSize();
   138     i = dijkstra_test.queueSize();
   139     
   139 
   140     dijkstra_test.start();
   140     dijkstra_test.start();
   141     dijkstra_test.start(t);
   141     dijkstra_test.start(t);
   142     dijkstra_test.start(nm);
   142     dijkstra_test.start(nm);
   143 
   143 
   144     l  = dijkstra_test.dist(t);
   144     l  = dijkstra_test.dist(t);