COIN-OR::LEMON - Graph Library

Changeset 1201:cb26a6250401 in lemon-0.x


Ignore:
Timestamp:
03/06/05 22:20:49 (20 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1613
Message:

Bugfix in DijkstraWizard?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/lemon/dijkstra.h

    r1196 r1201  
    730730    typedef DijkstraDefaultTraits<GR,LM> Base;
    731731  protected:
     732    /// Type of the nodes in the graph.
     733    typedef typename Base::Graph::Node Node;
     734
    732735    /// Pointer to the underlying graph.
    733736    void *_g;
     
    741744    void *_dist;
    742745    ///Pointer to the source node.
    743     void *_source;
    744 
    745     /// Type of the nodes in the graph.
    746     typedef typename Base::Graph::Node Node;
     746    Node _source;
    747747
    748748    public:
     
    752752    /// all of the attributes to default values (0, INVALID).
    753753    DijkstraWizardBase() : _g(0), _length(0), _pred(0), _predNode(0),
    754                        _dist(0), _source(0) {}
     754                       _dist(0), _source(INVALID) {}
    755755
    756756    /// Constructor.
     
    764764    DijkstraWizardBase(const GR &g,const LM &l, Node s=INVALID) :
    765765      _g((void *)&g), _length((void *)&l), _pred(0), _predNode(0),
    766                   _dist(0), _source((s==INVALID)?0:(void *)&s) {}
     766                  _dist(0), _source(s) {}
    767767
    768768  };
     
    841841    void run()
    842842    {
    843       if(Base::_source==0) throw UninitializedParameter();
     843      if(Base::_source==INVALID) throw UninitializedParameter();
    844844      Dijkstra<Graph,LengthMap,TR>
    845845        Dij(*(Graph*)Base::_g,*(LengthMap*)Base::_length);
     
    847847      if(Base::_predNode) Dij.predNodeMap(*(PredNodeMap*)Base::_predNode);
    848848      if(Base::_dist) Dij.distMap(*(DistMap*)Base::_dist);
    849       Dij.run(*(Node*)Base::_source);
     849      Dij.run(Base::_source);
    850850    }
    851851
     
    856856    void run(Node s)
    857857    {
    858       Base::_source=(void *)&s;
     858      Base::_source=s;
    859859      run();
    860860    }
     
    927927    DijkstraWizard<TR> &source(Node s)
    928928    {
    929       Base::_source=(void *)&s;
     929      Base::_source=s;
    930930      return *this;
    931931    }
Note: See TracChangeset for help on using the changeset viewer.