1.1 --- a/lemon/dfs.h Wed Oct 01 12:44:16 2008 +0200
1.2 +++ b/lemon/dfs.h Wed Oct 01 13:56:40 2008 +0200
1.3 @@ -136,16 +136,6 @@
1.4 #endif
1.5 class Dfs {
1.6 public:
1.7 - ///\ref Exception for uninitialized parameters.
1.8 -
1.9 - ///This error represents problems in the initialization of the
1.10 - ///parameters of the algorithm.
1.11 - class UninitializedParameter : public lemon::UninitializedParameter {
1.12 - public:
1.13 - virtual const char* what() const throw() {
1.14 - return "lemon::Dfs::UninitializedParameter";
1.15 - }
1.16 - };
1.17
1.18 ///The type of the digraph the algorithm runs on.
1.19 typedef typename TR::Digraph Digraph;
1.20 @@ -232,7 +222,8 @@
1.21 typedef T PredMap;
1.22 static PredMap *createPredMap(const Digraph &)
1.23 {
1.24 - throw UninitializedParameter();
1.25 + LEMON_ASSERT(false, "PredMap is not initialized");
1.26 + return 0; // ignore warnings
1.27 }
1.28 };
1.29 ///\brief \ref named-templ-param "Named parameter" for setting
1.30 @@ -250,7 +241,8 @@
1.31 typedef T DistMap;
1.32 static DistMap *createDistMap(const Digraph &)
1.33 {
1.34 - throw UninitializedParameter();
1.35 + LEMON_ASSERT(false, "DistMap is not initialized");
1.36 + return 0; // ignore warnings
1.37 }
1.38 };
1.39 ///\brief \ref named-templ-param "Named parameter" for setting
1.40 @@ -268,7 +260,8 @@
1.41 typedef T ReachedMap;
1.42 static ReachedMap *createReachedMap(const Digraph &)
1.43 {
1.44 - throw UninitializedParameter();
1.45 + LEMON_ASSERT(false, "ReachedMap is not initialized");
1.46 + return 0; // ignore warnings
1.47 }
1.48 };
1.49 ///\brief \ref named-templ-param "Named parameter" for setting
1.50 @@ -286,7 +279,8 @@
1.51 typedef T ProcessedMap;
1.52 static ProcessedMap *createProcessedMap(const Digraph &)
1.53 {
1.54 - throw UninitializedParameter();
1.55 + LEMON_ASSERT(false, "ProcessedMap is not initialized");
1.56 + return 0; // ignore warnings
1.57 }
1.58 };
1.59 ///\brief \ref named-templ-param "Named parameter" for setting
1.60 @@ -974,7 +968,6 @@
1.61 ///\return \c true if \c t is reachable form \c s.
1.62 bool run(Node s, Node t)
1.63 {
1.64 - if (s==INVALID || t==INVALID) throw UninitializedParameter();
1.65 Dfs<Digraph,TR> alg(*reinterpret_cast<const Digraph*>(Base::_g));
1.66 if (Base::_pred)
1.67 alg.predMap(*reinterpret_cast<PredMap*>(Base::_pred));
1.68 @@ -1270,18 +1263,6 @@
1.69 class DfsVisit {
1.70 public:
1.71
1.72 - /// \brief \ref Exception for uninitialized parameters.
1.73 - ///
1.74 - /// This error represents problems in the initialization
1.75 - /// of the parameters of the algorithm.
1.76 - class UninitializedParameter : public lemon::UninitializedParameter {
1.77 - public:
1.78 - virtual const char* what() const throw()
1.79 - {
1.80 - return "lemon::DfsVisit::UninitializedParameter";
1.81 - }
1.82 - };
1.83 -
1.84 ///The traits class.
1.85 typedef _Traits Traits;
1.86
1.87 @@ -1336,7 +1317,8 @@
1.88 struct SetReachedMapTraits : public Traits {
1.89 typedef T ReachedMap;
1.90 static ReachedMap *createReachedMap(const Digraph &digraph) {
1.91 - throw UninitializedParameter();
1.92 + LEMON_ASSERT(false, "ReachedMap is not initialized");
1.93 + return 0; // ignore warnings
1.94 }
1.95 };
1.96 /// \brief \ref named-templ-param "Named parameter" for setting