Changes in lemon/bfs.h [258:0310c8984732:252:66644b9cd9eb] in lemon-main
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/bfs.h
r258 r252 231 231 232 232 template <class T> 233 struct SetPredMapTraits : public Traits {233 struct DefPredMapTraits : public Traits { 234 234 typedef T PredMap; 235 235 static PredMap *createPredMap(const Digraph &) … … 244 244 ///\ref PredMap type. 245 245 template <class T> 246 struct SetPredMap : public Bfs< Digraph, SetPredMapTraits<T> > {247 typedef Bfs< Digraph, SetPredMapTraits<T> > Create;246 struct DefPredMap : public Bfs< Digraph, DefPredMapTraits<T> > { 247 typedef Bfs< Digraph, DefPredMapTraits<T> > Create; 248 248 }; 249 249 250 250 template <class T> 251 struct SetDistMapTraits : public Traits {251 struct DefDistMapTraits : public Traits { 252 252 typedef T DistMap; 253 253 static DistMap *createDistMap(const Digraph &) … … 262 262 ///\ref DistMap type. 263 263 template <class T> 264 struct SetDistMap : public Bfs< Digraph, SetDistMapTraits<T> > {265 typedef Bfs< Digraph, SetDistMapTraits<T> > Create;264 struct DefDistMap : public Bfs< Digraph, DefDistMapTraits<T> > { 265 typedef Bfs< Digraph, DefDistMapTraits<T> > Create; 266 266 }; 267 267 268 268 template <class T> 269 struct SetReachedMapTraits : public Traits {269 struct DefReachedMapTraits : public Traits { 270 270 typedef T ReachedMap; 271 271 static ReachedMap *createReachedMap(const Digraph &) … … 280 280 ///\ref ReachedMap type. 281 281 template <class T> 282 struct SetReachedMap : public Bfs< Digraph, SetReachedMapTraits<T> > {283 typedef Bfs< Digraph, SetReachedMapTraits<T> > Create;282 struct DefReachedMap : public Bfs< Digraph, DefReachedMapTraits<T> > { 283 typedef Bfs< Digraph, DefReachedMapTraits<T> > Create; 284 284 }; 285 285 286 286 template <class T> 287 struct SetProcessedMapTraits : public Traits {287 struct DefProcessedMapTraits : public Traits { 288 288 typedef T ProcessedMap; 289 289 static ProcessedMap *createProcessedMap(const Digraph &) … … 298 298 ///\ref ProcessedMap type. 299 299 template <class T> 300 struct SetProcessedMap : public Bfs< Digraph, SetProcessedMapTraits<T> > {301 typedef Bfs< Digraph, SetProcessedMapTraits<T> > Create;302 }; 303 304 struct SetStandardProcessedMapTraits : public Traits {300 struct DefProcessedMap : public Bfs< Digraph, DefProcessedMapTraits<T> > { 301 typedef Bfs< Digraph, DefProcessedMapTraits<T> > Create; 302 }; 303 304 struct DefDigraphProcessedMapTraits : public Traits { 305 305 typedef typename Digraph::template NodeMap<bool> ProcessedMap; 306 306 static ProcessedMap *createProcessedMap(const Digraph &g) … … 315 315 ///\ref ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>. 316 316 ///If you don't set it explicitly, it will be automatically allocated. 317 struct SetStandardProcessedMap : 318 public Bfs< Digraph, SetStandardProcessedMapTraits > { 319 typedef Bfs< Digraph, SetStandardProcessedMapTraits > Create; 317 template <class T> 318 struct DefProcessedMapToBeDefaultMap : 319 public Bfs< Digraph, DefDigraphProcessedMapTraits> { 320 typedef Bfs< Digraph, DefDigraphProcessedMapTraits> Create; 320 321 }; 321 322 … … 1065 1066 1066 1067 template<class T> 1067 struct SetPredMapBase : public Base {1068 struct DefPredMapBase : public Base { 1068 1069 typedef T PredMap; 1069 1070 static PredMap *createPredMap(const Digraph &) { return 0; }; 1070 SetPredMapBase(const TR &b) : TR(b) {}1071 DefPredMapBase(const TR &b) : TR(b) {} 1071 1072 }; 1072 1073 ///\brief \ref named-templ-param "Named parameter" … … 1076 1077 ///for setting \ref PredMap object. 1077 1078 template<class T> 1078 BfsWizard< SetPredMapBase<T> > predMap(const T &t)1079 BfsWizard<DefPredMapBase<T> > predMap(const T &t) 1079 1080 { 1080 1081 Base::_pred=reinterpret_cast<void*>(const_cast<T*>(&t)); 1081 return BfsWizard< SetPredMapBase<T> >(*this);1082 return BfsWizard<DefPredMapBase<T> >(*this); 1082 1083 } 1083 1084 1084 1085 template<class T> 1085 struct SetReachedMapBase : public Base {1086 struct DefReachedMapBase : public Base { 1086 1087 typedef T ReachedMap; 1087 1088 static ReachedMap *createReachedMap(const Digraph &) { return 0; }; 1088 SetReachedMapBase(const TR &b) : TR(b) {}1089 DefReachedMapBase(const TR &b) : TR(b) {} 1089 1090 }; 1090 1091 ///\brief \ref named-templ-param "Named parameter" … … 1094 1095 ///for setting \ref ReachedMap object. 1095 1096 template<class T> 1096 BfsWizard< SetReachedMapBase<T> > reachedMap(const T &t)1097 BfsWizard<DefReachedMapBase<T> > reachedMap(const T &t) 1097 1098 { 1098 1099 Base::_reached=reinterpret_cast<void*>(const_cast<T*>(&t)); 1099 return BfsWizard< SetReachedMapBase<T> >(*this);1100 return BfsWizard<DefReachedMapBase<T> >(*this); 1100 1101 } 1101 1102 1102 1103 template<class T> 1103 struct SetProcessedMapBase : public Base {1104 struct DefProcessedMapBase : public Base { 1104 1105 typedef T ProcessedMap; 1105 1106 static ProcessedMap *createProcessedMap(const Digraph &) { return 0; }; 1106 SetProcessedMapBase(const TR &b) : TR(b) {}1107 DefProcessedMapBase(const TR &b) : TR(b) {} 1107 1108 }; 1108 1109 ///\brief \ref named-templ-param "Named parameter" … … 1112 1113 ///for setting \ref ProcessedMap object. 1113 1114 template<class T> 1114 BfsWizard< SetProcessedMapBase<T> > processedMap(const T &t)1115 BfsWizard<DefProcessedMapBase<T> > processedMap(const T &t) 1115 1116 { 1116 1117 Base::_processed=reinterpret_cast<void*>(const_cast<T*>(&t)); 1117 return BfsWizard< SetProcessedMapBase<T> >(*this);1118 return BfsWizard<DefProcessedMapBase<T> >(*this); 1118 1119 } 1119 1120 1120 1121 template<class T> 1121 struct SetDistMapBase : public Base {1122 struct DefDistMapBase : public Base { 1122 1123 typedef T DistMap; 1123 1124 static DistMap *createDistMap(const Digraph &) { return 0; }; 1124 SetDistMapBase(const TR &b) : TR(b) {}1125 DefDistMapBase(const TR &b) : TR(b) {} 1125 1126 }; 1126 1127 ///\brief \ref named-templ-param "Named parameter" … … 1130 1131 ///for setting \ref DistMap object. 1131 1132 template<class T> 1132 BfsWizard< SetDistMapBase<T> > distMap(const T &t)1133 BfsWizard<DefDistMapBase<T> > distMap(const T &t) 1133 1134 { 1134 1135 Base::_dist=reinterpret_cast<void*>(const_cast<T*>(&t)); 1135 return BfsWizard< SetDistMapBase<T> >(*this);1136 return BfsWizard<DefDistMapBase<T> >(*this); 1136 1137 } 1137 1138 … … 1354 1355 ///@{ 1355 1356 template <class T> 1356 struct SetReachedMapTraits : public Traits {1357 struct DefReachedMapTraits : public Traits { 1357 1358 typedef T ReachedMap; 1358 1359 static ReachedMap *createReachedMap(const Digraph &digraph) { … … 1365 1366 /// \ref named-templ-param "Named parameter" for setting ReachedMap type. 1366 1367 template <class T> 1367 struct SetReachedMap : public BfsVisit< Digraph, Visitor,1368 SetReachedMapTraits<T> > {1369 typedef BfsVisit< Digraph, Visitor, SetReachedMapTraits<T> > Create;1368 struct DefReachedMap : public BfsVisit< Digraph, Visitor, 1369 DefReachedMapTraits<T> > { 1370 typedef BfsVisit< Digraph, Visitor, DefReachedMapTraits<T> > Create; 1370 1371 }; 1371 1372 ///@}
Note: See TracChangeset
for help on using the changeset viewer.