lemon/dijkstra.h
changeset 290 f6899946c1ac
parent 287 bb40b6db0a58
child 301 9db8964f0cf6
     1.1 --- a/lemon/dijkstra.h	Sat Sep 27 14:33:28 2008 +0200
     1.2 +++ b/lemon/dijkstra.h	Tue Sep 30 20:53:18 2008 +0200
     1.3 @@ -225,16 +225,6 @@
     1.4  #endif
     1.5    class Dijkstra {
     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::Dijkstra::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 @@ -332,7 +322,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 @@ -351,7 +342,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 @@ -370,7 +362,8 @@
    1.41        typedef T ProcessedMap;
    1.42        static ProcessedMap *createProcessedMap(const Digraph &)
    1.43        {
    1.44 -        throw UninitializedParameter();
    1.45 +        LEMON_ASSERT(false, "ProcessedMap 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 @@ -408,11 +401,13 @@
    1.51        typedef CR HeapCrossRef;
    1.52        typedef H Heap;
    1.53        static HeapCrossRef *createHeapCrossRef(const Digraph &) {
    1.54 -        throw UninitializedParameter();
    1.55 +        LEMON_ASSERT(false, "HeapCrossRef is not initialized");
    1.56 +        return 0; // ignore warnings
    1.57        }
    1.58        static Heap *createHeap(HeapCrossRef &)
    1.59        {
    1.60 -        throw UninitializedParameter();
    1.61 +        LEMON_ASSERT(false, "Heap is not initialized");
    1.62 +        return 0; // ignore warnings
    1.63        }
    1.64      };
    1.65      ///\brief \ref named-templ-param "Named parameter" for setting
    1.66 @@ -1158,7 +1153,6 @@
    1.67      ///in order to compute the shortest path to each node.
    1.68      void run(Node s)
    1.69      {
    1.70 -      if (s==INVALID) throw UninitializedParameter();
    1.71        Dijkstra<Digraph,LengthMap,TR>
    1.72          dijk(*reinterpret_cast<const Digraph*>(Base::_g),
    1.73               *reinterpret_cast<const LengthMap*>(Base::_length));
    1.74 @@ -1180,7 +1174,6 @@
    1.75      ///\return \c true if \c t is reachable form \c s.
    1.76      bool run(Node s, Node t)
    1.77      {
    1.78 -      if (s==INVALID || t==INVALID) throw UninitializedParameter();
    1.79        Dijkstra<Digraph,LengthMap,TR>
    1.80          dijk(*reinterpret_cast<const Digraph*>(Base::_g),
    1.81               *reinterpret_cast<const LengthMap*>(Base::_length));