Changeset 1201:cb26a6250401 in lemon0.x
 Timestamp:
 03/06/05 22:20:49 (15 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@1613
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

src/lemon/dijkstra.h
r1196 r1201 730 730 typedef DijkstraDefaultTraits<GR,LM> Base; 731 731 protected: 732 /// Type of the nodes in the graph. 733 typedef typename Base::Graph::Node Node; 734 732 735 /// Pointer to the underlying graph. 733 736 void *_g; … … 741 744 void *_dist; 742 745 ///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; 747 747 748 748 public: … … 752 752 /// all of the attributes to default values (0, INVALID). 753 753 DijkstraWizardBase() : _g(0), _length(0), _pred(0), _predNode(0), 754 _dist(0), _source( 0) {}754 _dist(0), _source(INVALID) {} 755 755 756 756 /// Constructor. … … 764 764 DijkstraWizardBase(const GR &g,const LM &l, Node s=INVALID) : 765 765 _g((void *)&g), _length((void *)&l), _pred(0), _predNode(0), 766 _dist(0), _source( (s==INVALID)?0:(void *)&s) {}766 _dist(0), _source(s) {} 767 767 768 768 }; … … 841 841 void run() 842 842 { 843 if(Base::_source== 0) throw UninitializedParameter();843 if(Base::_source==INVALID) throw UninitializedParameter(); 844 844 Dijkstra<Graph,LengthMap,TR> 845 845 Dij(*(Graph*)Base::_g,*(LengthMap*)Base::_length); … … 847 847 if(Base::_predNode) Dij.predNodeMap(*(PredNodeMap*)Base::_predNode); 848 848 if(Base::_dist) Dij.distMap(*(DistMap*)Base::_dist); 849 Dij.run( *(Node*)Base::_source);849 Dij.run(Base::_source); 850 850 } 851 851 … … 856 856 void run(Node s) 857 857 { 858 Base::_source= (void *)&s;858 Base::_source=s; 859 859 run(); 860 860 } … … 927 927 DijkstraWizard<TR> &source(Node s) 928 928 { 929 Base::_source= (void *)&s;929 Base::_source=s; 930 930 return *this; 931 931 }
Note: See TracChangeset
for help on using the changeset viewer.