Changeset 2386:81b47fc5c444 in lemon0.x for lemon/dijkstra.h
 Timestamp:
 03/02/07 19:04:28 (13 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@3217
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

lemon/dijkstra.h
r2376 r2386 488 488 ///automatically allocated heap and cross reference, of course. 489 489 ///\return <tt> (*this) </tt> 490 Dijkstra &heap(Heap& h eap, HeapCrossRef &crossRef)490 Dijkstra &heap(Heap& hp, HeapCrossRef &cr) 491 491 { 492 492 if(local_heap_cross_ref) { … … 494 494 local_heap_cross_ref=false; 495 495 } 496 _heap_cross_ref = &cr ossRef;496 _heap_cross_ref = &cr; 497 497 if(local_heap) { 498 498 delete _heap; 499 499 local_heap=false; 500 500 } 501 _heap = &h eap;501 _heap = &hp; 502 502 return *this; 503 503 } … … 963 963 /// \param s is the initial value of \ref _source 964 964 DijkstraWizardBase(const GR &g,const LM &l, Node s=INVALID) : 965 _g((void *)&g), _length((void *)&l), _pred(0), 966 _dist(0), _source(s) {} 965 _g(reinterpret_cast<void*>(const_cast<GR*>(&g))), 966 _length(reinterpret_cast<void*>(const_cast<LM*>(&l))), 967 _pred(0), _dist(0), _source(s) {} 967 968 968 969 }; … … 1038 1039 if(Base::_source==INVALID) throw UninitializedParameter(); 1039 1040 Dijkstra<Graph,LengthMap,TR> 1040 dij(*(Graph*)Base::_g,*(LengthMap*)Base::_length); 1041 if(Base::_pred) dij.predMap(*(PredMap*)Base::_pred); 1042 if(Base::_dist) dij.distMap(*(DistMap*)Base::_dist); 1041 dij(*reinterpret_cast<const Graph*>(Base::_g), 1042 *reinterpret_cast<const LengthMap*>(Base::_length)); 1043 if(Base::_pred) dij.predMap(*reinterpret_cast<PredMap*>(Base::_pred)); 1044 if(Base::_dist) dij.distMap(*reinterpret_cast<DistMap*>(Base::_dist)); 1043 1045 dij.run(Base::_source); 1044 1046 } … … 1070 1072 DijkstraWizard<DefPredMapBase<T> > predMap(const T &t) 1071 1073 { 1072 Base::_pred= (void *)&t;1074 Base::_pred=reinterpret_cast<void*>(const_cast<T*>(&t)); 1073 1075 return DijkstraWizard<DefPredMapBase<T> >(*this); 1074 1076 } … … 1090 1092 DijkstraWizard<DefDistMapBase<T> > distMap(const T &t) 1091 1093 { 1092 Base::_dist= (void *)&t;1094 Base::_dist=reinterpret_cast<void*>(const_cast<T*>(&t)); 1093 1095 return DijkstraWizard<DefDistMapBase<T> >(*this); 1094 1096 }
Note: See TracChangeset
for help on using the changeset viewer.