# HG changeset patch # User Alpar Juttner # Date 2008-11-21 15:26:58 # Node ID 53c5277ba2941ac7d5e734d9413792c679f18f60 # Parent 660db48f324f9becef9aee3407289d4ce146a79e Get rid of exceptions in Preflow diff --git a/lemon/preflow.h b/lemon/preflow.h --- a/lemon/preflow.h +++ b/lemon/preflow.h @@ -19,7 +19,6 @@ #ifndef LEMON_PREFLOW_H #define LEMON_PREFLOW_H -#include #include #include @@ -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 } };