COIN-OR::LEMON - Graph Library

Changeset 1193:c3585aec8cb3 in lemon-0.x


Ignore:
Timestamp:
03/04/05 18:18:25 (20 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1605
Message:

Bug fix, and g++ 3.4 compatibility changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/lemon/dijkstra.h

    r1164 r1193  
    338338   
    339339    struct DefGraphReachedMapTraits : public Traits {
    340       typedef typename Graph::NodeMap<bool> ReachedMap;
     340      typedef typename Graph::template NodeMap<bool> ReachedMap;
    341341      static ReachedMap *createReachedMap(const Graph &G)
    342342      {
     
    540540    ///Returns \c false if there are nodes to be processed in the priority heap
    541541    ///
    542     bool emptyHeap() { return heap.empty(); }
     542    bool emptyHeap() { return _heap.empty(); }
    543543    ///Returns the number of the nodes to be processed in the priority heap
    544544
    545545    ///Returns the number of the nodes to be processed in the priority heap
    546546    ///
    547     int heapSize() { return heap.size(); }
     547    int heapSize() { return _heap.size(); }
    548548   
    549549    ///Executes the algorithm.
     
    598598    void start(const NM &nm)
    599599    {
    600       while ( !_heap.empty() && !mn[_heap.top()] ) processNextNode();
     600      while ( !_heap.empty() && !nm[_heap.top()] ) processNextNode();
    601601      if ( !_heap.empty() ) finalizeNodeData(_heap.top());
    602602    }
     
    841841    void run()
    842842    {
    843       if(_source==0) throw UninitializedParameter();
    844       Dijkstra<Graph,LengthMap,TR> Dij(*(Graph*)_g,*(LengthMap*)_length);
    845       if(_pred) Dij.predMap(*(PredMap*)_pred);
    846       if(_predNode) Dij.predNodeMap(*(PredNodeMap*)_predNode);
    847       if(_dist) Dij.distMap(*(DistMap*)_dist);
    848       Dij.run(*(Node*)_source);
     843      if(Base::_source==0) throw UninitializedParameter();
     844      Dijkstra<Graph,LengthMap,TR>
     845        Dij(*(Graph*)Base::_g,*(LengthMap*)Base::_length);
     846      if(Base::_pred) Dij.predMap(*(PredMap*)Base::_pred);
     847      if(Base::_predNode) Dij.predNodeMap(*(PredNodeMap*)Base::_predNode);
     848      if(Base::_dist) Dij.distMap(*(DistMap*)Base::_dist);
     849      Dij.run(*(Node*)Base::_source);
    849850    }
    850851
     
    855856    void run(Node s)
    856857    {
    857       _source=(void *)&s;
     858      Base::_source=(void *)&s;
    858859      run();
    859860    }
     
    875876    DijkstraWizard<DefPredMapBase<T> > predMap(const T &t)
    876877    {
    877       _pred=(void *)&t;
     878      Base::_pred=(void *)&t;
    878879      return DijkstraWizard<DefPredMapBase<T> >(*this);
    879880    }
     
    896897    DijkstraWizard<DefPredNodeMapBase<T> > predNodeMap(const T &t)
    897898    {
    898       _predNode=(void *)&t;
     899      Base::_predNode=(void *)&t;
    899900      return DijkstraWizard<DefPredNodeMapBase<T> >(*this);
    900901    }
     
    916917    DijkstraWizard<DefDistMapBase<T> > distMap(const T &t)
    917918    {
    918       _dist=(void *)&t;
     919      Base::_dist=(void *)&t;
    919920      return DijkstraWizard<DefDistMapBase<T> >(*this);
    920921    }
     
    926927    DijkstraWizard<TR> &source(Node s)
    927928    {
    928       source=(void *)&s;
     929      Base::_source=(void *)&s;
    929930      return *this;
    930931    }
Note: See TracChangeset for help on using the changeset viewer.