Changeset 2386:81b47fc5c444 in lemon-0.x for lemon/dfs.h
- Timestamp:
- 03/02/07 19:04:28 (17 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3217
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/dfs.h
r2376 r2386 859 859 /// \param s is the initial value of \ref _source 860 860 DfsWizardBase(const GR &g, Node s=INVALID) : 861 _g( (void *)&g), _reached(0), _processed(0), _pred(0),862 _ dist(0), _source(s) {}861 _g(reinterpret_cast<void*>(const_cast<GR*>(&g))), 862 _reached(0), _processed(0), _pred(0), _dist(0), _source(s) {} 863 863 864 864 }; … … 934 934 { 935 935 if(Base::_source==INVALID) throw UninitializedParameter(); 936 Dfs<Graph,TR> alg(*(Graph*)Base::_g); 937 if(Base::_reached) alg.reachedMap(*(ReachedMap*)Base::_reached); 938 if(Base::_processed) alg.processedMap(*(ProcessedMap*)Base::_processed); 939 if(Base::_pred) alg.predMap(*(PredMap*)Base::_pred); 940 if(Base::_dist) alg.distMap(*(DistMap*)Base::_dist); 936 Dfs<Graph,TR> alg(*reinterpret_cast<const Graph*>(Base::_g)); 937 if(Base::_reached) 938 alg.reachedMap(*reinterpret_cast<ReachedMap*>(Base::_reached)); 939 if(Base::_processed) 940 alg.processedMap(*reinterpret_cast<ProcessedMap*>(Base::_processed)); 941 if(Base::_pred) 942 alg.predMap(*reinterpret_cast<PredMap*>(Base::_pred)); 943 if(Base::_dist) 944 alg.distMap(*reinterpret_cast<DistMap*>(Base::_dist)); 941 945 alg.run(Base::_source); 942 946 } … … 968 972 DfsWizard<DefPredMapBase<T> > predMap(const T &t) 969 973 { 970 Base::_pred= (void *)&t;974 Base::_pred=reinterpret_cast<void*>(const_cast<T*>(&t)); 971 975 return DfsWizard<DefPredMapBase<T> >(*this); 972 976 } … … 989 993 DfsWizard<DefReachedMapBase<T> > reachedMap(const T &t) 990 994 { 991 Base::_pred= (void *)&t;995 Base::_pred=reinterpret_cast<void*>(const_cast<T*>(&t)); 992 996 return DfsWizard<DefReachedMapBase<T> >(*this); 993 997 } … … 1010 1014 DfsWizard<DefProcessedMapBase<T> > processedMap(const T &t) 1011 1015 { 1012 Base::_pred= (void *)&t;1016 Base::_pred=reinterpret_cast<void*>(const_cast<T*>(&t)); 1013 1017 return DfsWizard<DefProcessedMapBase<T> >(*this); 1014 1018 } … … 1030 1034 DfsWizard<DefDistMapBase<T> > distMap(const T &t) 1031 1035 { 1032 Base::_dist= (void *)&t;1036 Base::_dist=reinterpret_cast<void*>(const_cast<T*>(&t)); 1033 1037 return DfsWizard<DefDistMapBase<T> >(*this); 1034 1038 }
Note: See TracChangeset
for help on using the changeset viewer.