Changeset 290:f6899946c1ac in lemon-1.2 for lemon/bfs.h
- Timestamp:
- 09/30/08 20:53:18 (15 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/bfs.h
r287 r290 136 136 class Bfs { 137 137 public: 138 ///\ref Exception for uninitialized parameters.139 140 ///This error represents problems in the initialization of the141 ///parameters of the algorithm.142 class UninitializedParameter : public lemon::UninitializedParameter {143 public:144 virtual const char* what() const throw() {145 return "lemon::Bfs::UninitializedParameter";146 }147 };148 138 149 139 ///The type of the digraph the algorithm runs on. … … 233 223 static PredMap *createPredMap(const Digraph &) 234 224 { 235 throw UninitializedParameter(); 225 LEMON_ASSERT(false, "PredMap is not initialized"); 226 return 0; // ignore warnings 236 227 } 237 228 }; … … 251 242 static DistMap *createDistMap(const Digraph &) 252 243 { 253 throw UninitializedParameter(); 244 LEMON_ASSERT(false, "DistMap is not initialized"); 245 return 0; // ignore warnings 254 246 } 255 247 }; … … 269 261 static ReachedMap *createReachedMap(const Digraph &) 270 262 { 271 throw UninitializedParameter(); 263 LEMON_ASSERT(false, "ReachedMap is not initialized"); 264 return 0; // ignore warnings 272 265 } 273 266 }; … … 287 280 static ProcessedMap *createProcessedMap(const Digraph &) 288 281 { 289 throw UninitializedParameter(); 282 LEMON_ASSERT(false, "ProcessedMap is not initialized"); 283 return 0; // ignore warnings 290 284 } 291 285 }; … … 305 299 { 306 300 return new ProcessedMap(g); 301 return 0; // ignore warnings 307 302 } 308 303 }; … … 1041 1036 bool run(Node s, Node t) 1042 1037 { 1043 if (s==INVALID || t==INVALID) throw UninitializedParameter();1044 1038 Bfs<Digraph,TR> alg(*reinterpret_cast<const Digraph*>(Base::_g)); 1045 1039 if (Base::_pred) … … 1324 1318 public: 1325 1319 1326 /// \brief \ref Exception for uninitialized parameters.1327 ///1328 /// This error represents problems in the initialization1329 /// of the parameters of the algorithm.1330 class UninitializedParameter : public lemon::UninitializedParameter {1331 public:1332 virtual const char* what() const throw()1333 {1334 return "lemon::BfsVisit::UninitializedParameter";1335 }1336 };1337 1338 1320 ///The traits class. 1339 1321 typedef _Traits Traits; … … 1390 1372 typedef T ReachedMap; 1391 1373 static ReachedMap *createReachedMap(const Digraph &digraph) { 1392 throw UninitializedParameter(); 1374 LEMON_ASSERT(false, "ReachedMap is not initialized"); 1375 return 0; // ignore warnings 1393 1376 } 1394 1377 };
Note: See TracChangeset
for help on using the changeset viewer.