Changes in lemon/bfs.h [252:66644b9cd9eb:258:0310c8984732] in lemon1.2
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

lemon/bfs.h
r252 r258 231 231 232 232 template <class T> 233 struct DefPredMapTraits : public Traits {233 struct SetPredMapTraits : 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 DefPredMap : public Bfs< Digraph, DefPredMapTraits<T> > {247 typedef Bfs< Digraph, DefPredMapTraits<T> > Create;246 struct SetPredMap : public Bfs< Digraph, SetPredMapTraits<T> > { 247 typedef Bfs< Digraph, SetPredMapTraits<T> > Create; 248 248 }; 249 249 250 250 template <class T> 251 struct DefDistMapTraits : public Traits {251 struct SetDistMapTraits : 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 DefDistMap : public Bfs< Digraph, DefDistMapTraits<T> > {265 typedef Bfs< Digraph, DefDistMapTraits<T> > Create;264 struct SetDistMap : public Bfs< Digraph, SetDistMapTraits<T> > { 265 typedef Bfs< Digraph, SetDistMapTraits<T> > Create; 266 266 }; 267 267 268 268 template <class T> 269 struct DefReachedMapTraits : public Traits {269 struct SetReachedMapTraits : 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 DefReachedMap : public Bfs< Digraph, DefReachedMapTraits<T> > {283 typedef Bfs< Digraph, DefReachedMapTraits<T> > Create;282 struct SetReachedMap : public Bfs< Digraph, SetReachedMapTraits<T> > { 283 typedef Bfs< Digraph, SetReachedMapTraits<T> > Create; 284 284 }; 285 285 286 286 template <class T> 287 struct DefProcessedMapTraits : public Traits {287 struct SetProcessedMapTraits : 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 DefProcessedMap : public Bfs< Digraph, DefProcessedMapTraits<T> > {301 typedef Bfs< Digraph, DefProcessedMapTraits<T> > Create;302 }; 303 304 struct DefDigraphProcessedMapTraits : public Traits {300 struct SetProcessedMap : public Bfs< Digraph, SetProcessedMapTraits<T> > { 301 typedef Bfs< Digraph, SetProcessedMapTraits<T> > Create; 302 }; 303 304 struct SetStandardProcessedMapTraits : 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 template <class T> 318 struct DefProcessedMapToBeDefaultMap : 319 public Bfs< Digraph, DefDigraphProcessedMapTraits> { 320 typedef Bfs< Digraph, DefDigraphProcessedMapTraits> Create; 317 struct SetStandardProcessedMap : 318 public Bfs< Digraph, SetStandardProcessedMapTraits > { 319 typedef Bfs< Digraph, SetStandardProcessedMapTraits > Create; 321 320 }; 322 321 … … 1066 1065 1067 1066 template<class T> 1068 struct DefPredMapBase : public Base {1067 struct SetPredMapBase : public Base { 1069 1068 typedef T PredMap; 1070 1069 static PredMap *createPredMap(const Digraph &) { return 0; }; 1071 DefPredMapBase(const TR &b) : TR(b) {}1070 SetPredMapBase(const TR &b) : TR(b) {} 1072 1071 }; 1073 1072 ///\brief \ref namedtemplparam "Named parameter" … … 1077 1076 ///for setting \ref PredMap object. 1078 1077 template<class T> 1079 BfsWizard< DefPredMapBase<T> > predMap(const T &t)1078 BfsWizard<SetPredMapBase<T> > predMap(const T &t) 1080 1079 { 1081 1080 Base::_pred=reinterpret_cast<void*>(const_cast<T*>(&t)); 1082 return BfsWizard< DefPredMapBase<T> >(*this);1081 return BfsWizard<SetPredMapBase<T> >(*this); 1083 1082 } 1084 1083 1085 1084 template<class T> 1086 struct DefReachedMapBase : public Base {1085 struct SetReachedMapBase : public Base { 1087 1086 typedef T ReachedMap; 1088 1087 static ReachedMap *createReachedMap(const Digraph &) { return 0; }; 1089 DefReachedMapBase(const TR &b) : TR(b) {}1088 SetReachedMapBase(const TR &b) : TR(b) {} 1090 1089 }; 1091 1090 ///\brief \ref namedtemplparam "Named parameter" … … 1095 1094 ///for setting \ref ReachedMap object. 1096 1095 template<class T> 1097 BfsWizard< DefReachedMapBase<T> > reachedMap(const T &t)1096 BfsWizard<SetReachedMapBase<T> > reachedMap(const T &t) 1098 1097 { 1099 1098 Base::_reached=reinterpret_cast<void*>(const_cast<T*>(&t)); 1100 return BfsWizard< DefReachedMapBase<T> >(*this);1099 return BfsWizard<SetReachedMapBase<T> >(*this); 1101 1100 } 1102 1101 1103 1102 template<class T> 1104 struct DefProcessedMapBase : public Base {1103 struct SetProcessedMapBase : public Base { 1105 1104 typedef T ProcessedMap; 1106 1105 static ProcessedMap *createProcessedMap(const Digraph &) { return 0; }; 1107 DefProcessedMapBase(const TR &b) : TR(b) {}1106 SetProcessedMapBase(const TR &b) : TR(b) {} 1108 1107 }; 1109 1108 ///\brief \ref namedtemplparam "Named parameter" … … 1113 1112 ///for setting \ref ProcessedMap object. 1114 1113 template<class T> 1115 BfsWizard< DefProcessedMapBase<T> > processedMap(const T &t)1114 BfsWizard<SetProcessedMapBase<T> > processedMap(const T &t) 1116 1115 { 1117 1116 Base::_processed=reinterpret_cast<void*>(const_cast<T*>(&t)); 1118 return BfsWizard< DefProcessedMapBase<T> >(*this);1117 return BfsWizard<SetProcessedMapBase<T> >(*this); 1119 1118 } 1120 1119 1121 1120 template<class T> 1122 struct DefDistMapBase : public Base {1121 struct SetDistMapBase : public Base { 1123 1122 typedef T DistMap; 1124 1123 static DistMap *createDistMap(const Digraph &) { return 0; }; 1125 DefDistMapBase(const TR &b) : TR(b) {}1124 SetDistMapBase(const TR &b) : TR(b) {} 1126 1125 }; 1127 1126 ///\brief \ref namedtemplparam "Named parameter" … … 1131 1130 ///for setting \ref DistMap object. 1132 1131 template<class T> 1133 BfsWizard< DefDistMapBase<T> > distMap(const T &t)1132 BfsWizard<SetDistMapBase<T> > distMap(const T &t) 1134 1133 { 1135 1134 Base::_dist=reinterpret_cast<void*>(const_cast<T*>(&t)); 1136 return BfsWizard< DefDistMapBase<T> >(*this);1135 return BfsWizard<SetDistMapBase<T> >(*this); 1137 1136 } 1138 1137 … … 1355 1354 ///@{ 1356 1355 template <class T> 1357 struct DefReachedMapTraits : public Traits {1356 struct SetReachedMapTraits : public Traits { 1358 1357 typedef T ReachedMap; 1359 1358 static ReachedMap *createReachedMap(const Digraph &digraph) { … … 1366 1365 /// \ref namedtemplparam "Named parameter" for setting ReachedMap type. 1367 1366 template <class T> 1368 struct DefReachedMap : public BfsVisit< Digraph, Visitor,1369 DefReachedMapTraits<T> > {1370 typedef BfsVisit< Digraph, Visitor, DefReachedMapTraits<T> > Create;1367 struct SetReachedMap : public BfsVisit< Digraph, Visitor, 1368 SetReachedMapTraits<T> > { 1369 typedef BfsVisit< Digraph, Visitor, SetReachedMapTraits<T> > Create; 1371 1370 }; 1372 1371 ///@}
Note: See TracChangeset
for help on using the changeset viewer.