COIN-OR::LEMON - Graph Library

Changeset 532:2544205de129 in lemon-0.x for src/include/dijkstra.h


Ignore:
Timestamp:
05/05/04 10:18:19 (20 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@698
Message:

Compiles also with icc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/include/dijkstra.h

    r491 r532  
    4646  template <typename Graph,
    4747            typename LengthMap=typename Graph::template EdgeMap<int>,
    48             template <class,class,class> class Heap = BinHeap >
     48            template <class,class,class,class> class Heap = BinHeap >
    4949#endif
    5050  class Dijkstra{
     
    147147  ///- The distance of each node from the root.
    148148  template <typename Graph, typename LengthMap,
    149             template<class,class,class> class Heap >
     149            template<class,class,class,class> class Heap >
    150150  void Dijkstra<Graph,LengthMap,Heap>::run(Node s) {
    151151   
     
    158158    typename Graph::template NodeMap<int> heap_map(G,-1);
    159159   
    160     Heap<Node, ValueType, typename Graph::template NodeMap<int> >
    161       heap(heap_map);
     160    typedef Heap<Node, ValueType, typename Graph::template NodeMap<int>,
     161      std::less<ValueType> >
     162      HeapType;
     163   
     164    HeapType heap(heap_map);
    162165   
    163166    heap.push(s,0);
     
    177180         
    178181          switch(heap.state(w)) {
    179           case heap.PRE_HEAP:
     182          case HeapType::PRE_HEAP:
    180183            heap.push(w,oldvalue+length[e]);
    181184            predecessor.set(w,e);
    182185            pred_node.set(w,v);
    183186            break;
    184           case heap.IN_HEAP:
     187          case HeapType::IN_HEAP:
    185188            if ( oldvalue+length[e] < heap[w] ) {
    186189              heap.decrease(w, oldvalue+length[e]);
     
    189192            }
    190193            break;
    191           case heap.POST_HEAP:
     194          case HeapType::POST_HEAP:
    192195            break;
    193196          }
Note: See TracChangeset for help on using the changeset viewer.