# HG changeset patch
# User Alpar Juttner <alpar@cs.elte.hu>
# Date 1227277618 0
# Node ID 53c5277ba2941ac7d5e734d9413792c679f18f60
# Parent  660db48f324f9becef9aee3407289d4ce146a79e
Get rid of exceptions in Preflow

diff -r 660db48f324f -r 53c5277ba294 lemon/preflow.h
--- a/lemon/preflow.h	Fri Nov 21 14:11:29 2008 +0000
+++ b/lemon/preflow.h	Fri Nov 21 14:26:58 2008 +0000
@@ -19,7 +19,6 @@
 #ifndef LEMON_PREFLOW_H
 #define LEMON_PREFLOW_H
 
-#include <lemon/error.h>
 #include <lemon/tolerance.h>
 #include <lemon/elevator.h>
 
@@ -132,17 +131,6 @@
     typedef typename Traits::Elevator Elevator;
     typedef typename Traits::Tolerance Tolerance;
 
-    /// \brief \ref Exception for uninitialized parameters.
-    ///
-    /// This error represents problems in the initialization
-    /// of the parameters of the algorithms.
-    class UninitializedParameter : public lemon::Exception {
-    public:
-      virtual const char* what() const throw() {
-        return "lemon::Preflow::UninitializedParameter";
-      }
-    };
-
   private:
 
     TEMPLATE_DIGRAPH_TYPEDEFS(Digraph);
@@ -208,7 +196,8 @@
     struct DefFlowMapTraits : public Traits {
       typedef _FlowMap FlowMap;
       static FlowMap *createFlowMap(const Digraph&) {
-        throw UninitializedParameter();
+        LEMON_ASSERT(false, "FlowMap is not initialized");
+        return 0; // ignore warnings
       }
     };
 
@@ -228,7 +217,8 @@
     struct DefElevatorTraits : public Traits {
       typedef _Elevator Elevator;
       static Elevator *createElevator(const Digraph&, int) {
-        throw UninitializedParameter();
+        LEMON_ASSERT(false, "Elevator is not initialized");
+        return 0; // ignore warnings
       }
     };