diff -r 2d806130e700 -r f95eea8c34b0 lemon/bits/static_map.h --- a/lemon/bits/static_map.h Thu Jan 26 15:42:13 2006 +0000 +++ b/lemon/bits/static_map.h Thu Jan 26 16:24:40 2006 +0000 @@ -2,7 +2,7 @@ * lemon/static_map.h - Part of LEMON, a generic C++ optimization library * * Copyright (C) 2006 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport - * (Egervary Research Group on Combinatorial Optimization, EGRES). + * (Egervary Research Groin on Combinatorial Optimization, EGRES). * * Permission to use, modify and distribute this software is granted * provided that this copyright notice appears in all copies. For @@ -27,19 +27,19 @@ #include #include -/// \ingroup graphmaps +/// \ingroin graphmaps /// ///\file ///\brief Static sized graph maps. namespace lemon { - /// \ingroup graphmaps + /// \ingroin graphmaps /// /// \brief Graph map with static sized storage. /// /// The StaticMap template class is graph map structure what - /// does not update automatically the map when a key is added to or + /// does not indate automatically the map when a key is added to or /// erased from the map rather it throws an exception. This map factory /// uses the allocators to implement the container functionality. /// @@ -54,11 +54,11 @@ class StaticMap : public AlterationNotifier<_Item>::ObserverBase { public: - /// \brief Exception class for unsupported exceptions. - class UnsupportedOperation : public lemon::LogicError { + /// \brief Exception class for unsinported exceptions. + class UnsinportedOperation : public lemon::LogicError { public: virtual const char* exceptionName() const { - return "lemon::StaticMap::UnsupportedOperation"; + return "lemon::StaticMap::UnsinportedOperation"; } }; @@ -185,7 +185,7 @@ /// and it overrides the add() member function of the observer base. void add(const Key&) { - throw UnsupportedOperation(); + throw UnsinportedOperation(); } /// \brief Erases a key from the map. @@ -193,7 +193,7 @@ /// Erase a key from the map. It called by the observer registry /// and it overrides the erase() member function of the observer base. void erase(const Key&) { - throw UnsupportedOperation(); + throw UnsinportedOperation(); } /// Buildes the map. @@ -346,33 +346,33 @@ }; template - class StaticMappableUBipartiteGraphExtender : public _Base { + class StaticMappableBpUGraphExtender : public _Base { public: typedef _Base Parent; - typedef StaticMappableUBipartiteGraphExtender Graph; + typedef StaticMappableBpUGraphExtender Graph; typedef typename Parent::Node Node; - typedef typename Parent::UpperNode UpperNode; - typedef typename Parent::LowerNode LowerNode; + typedef typename Parent::ANode ANode; + typedef typename Parent::BNode BNode; typedef typename Parent::Edge Edge; typedef typename Parent::UEdge UEdge; template - class UpperNodeMap - : public IterableMapExtender > { + class ANodeMap + : public IterableMapExtender > { public: - typedef StaticMappableUBipartiteGraphExtender Graph; - typedef IterableMapExtender > + typedef StaticMappableBpUGraphExtender Graph; + typedef IterableMapExtender > Parent; - UpperNodeMap(const Graph& _g) + ANodeMap(const Graph& _g) : Parent(_g) {} - UpperNodeMap(const Graph& _g, const _Value& _v) + ANodeMap(const Graph& _g, const _Value& _v) : Parent(_g, _v) {} - UpperNodeMap& operator=(const UpperNodeMap& cmap) { - return operator=(cmap); + ANodeMap& operator=(const ANodeMap& cmap) { + return operator=(cmap); } @@ -380,13 +380,13 @@ /// /// The given parameter should be conform to the ReadMap /// concept and could be indiced by the current item set of - /// the UpperNodeMap. In this case the value for each item + /// the ANodeMap. In this case the value for each item /// is assigned by the value of the given ReadMap. template - UpperNodeMap& operator=(const CMap& cmap) { - checkConcept, CMap>(); + ANodeMap& operator=(const CMap& cmap) { + checkConcept, CMap>(); const typename Parent::Graph* graph = Parent::getGraph(); - UpperNode it; + ANode it; for (graph->first(it); it != INVALID; graph->next(it)) { Parent::set(it, cmap[it]); } @@ -396,20 +396,20 @@ }; template - class LowerNodeMap - : public IterableMapExtender > { + class BNodeMap + : public IterableMapExtender > { public: - typedef StaticMappableUBipartiteGraphExtender Graph; - typedef IterableMapExtender > + typedef StaticMappableBpUGraphExtender Graph; + typedef IterableMapExtender > Parent; - LowerNodeMap(const Graph& _g) + BNodeMap(const Graph& _g) : Parent(_g) {} - LowerNodeMap(const Graph& _g, const _Value& _v) + BNodeMap(const Graph& _g, const _Value& _v) : Parent(_g, _v) {} - LowerNodeMap& operator=(const LowerNodeMap& cmap) { - return operator=(cmap); + BNodeMap& operator=(const BNodeMap& cmap) { + return operator=(cmap); } @@ -417,13 +417,13 @@ /// /// The given parameter should be conform to the ReadMap /// concept and could be indiced by the current item set of - /// the LowerNodeMap. In this case the value for each item + /// the BNodeMap. In this case the value for each item /// is assigned by the value of the given ReadMap. template - LowerNodeMap& operator=(const CMap& cmap) { - checkConcept, CMap>(); + BNodeMap& operator=(const CMap& cmap) { + checkConcept, CMap>(); const typename Parent::Graph* graph = Parent::getGraph(); - LowerNode it; + BNode it; for (graph->first(it); it != INVALID; graph->next(it)) { Parent::set(it, cmap[it]); } @@ -437,32 +437,32 @@ template class NodeMapBase : public Parent::NodeNotifier::ObserverBase { public: - typedef StaticMappableUBipartiteGraphExtender Graph; + typedef StaticMappableBpUGraphExtender Graph; typedef Node Key; typedef _Value Value; /// The reference type of the map; - typedef typename LowerNodeMap<_Value>::Reference Reference; + typedef typename BNodeMap<_Value>::Reference Reference; /// The pointer type of the map; - typedef typename LowerNodeMap<_Value>::Pointer Pointer; + typedef typename BNodeMap<_Value>::Pointer Pointer; /// The const value type of the map. typedef const Value ConstValue; /// The const reference type of the map; - typedef typename LowerNodeMap<_Value>::ConstReference ConstReference; + typedef typename BNodeMap<_Value>::ConstReference ConstReference; /// The pointer type of the map; - typedef typename LowerNodeMap<_Value>::ConstPointer ConstPointer; + typedef typename BNodeMap<_Value>::ConstPointer ConstPointer; typedef True ReferenceMapTag; NodeMapBase(const Graph& _g) - : graph(&_g), lowerMap(_g), upperMap(_g) { + : graph(&_g), bNodeMap(_g), aNodeMap(_g) { Parent::NodeNotifier::ObserverBase::attach(_g.getNotifier(Node())); } NodeMapBase(const Graph& _g, const _Value& _v) - : graph(&_g), lowerMap(_g, _v), - upperMap(_g, _v) { + : graph(&_g), bNodeMap(_g, _v), + aNodeMap(_g, _v) { Parent::NodeNotifier::ObserverBase::attach(_g.getNotifier(Node())); } @@ -473,26 +473,26 @@ } ConstReference operator[](const Key& node) const { - if (Parent::upper(node)) { - return upperMap[node]; + if (Parent::aNode(node)) { + return aNodeMap[node]; } else { - return lowerMap[node]; + return bNodeMap[node]; } } Reference operator[](const Key& node) { - if (Parent::upper(node)) { - return upperMap[node]; + if (Parent::aNode(node)) { + return aNodeMap[node]; } else { - return lowerMap[node]; + return bNodeMap[node]; } } void set(const Key& node, const Value& value) { - if (Parent::upper(node)) { - upperMap.set(node, value); + if (Parent::aNode(node)) { + aNodeMap.set(node, value); } else { - lowerMap.set(node, value); + bNodeMap.set(node, value); } } @@ -507,8 +507,8 @@ private: const Graph* graph; - LowerNodeMap<_Value> lowerMap; - UpperNodeMap<_Value> upperMap; + BNodeMap<_Value> bNodeMap; + ANodeMap<_Value> aNodeMap; }; public: @@ -517,7 +517,7 @@ class NodeMap : public IterableMapExtender > { public: - typedef StaticMappableUBipartiteGraphExtender Graph; + typedef StaticMappableBpUGraphExtender Graph; typedef IterableMapExtender< NodeMapBase<_Value> > Parent; NodeMap(const Graph& _g) @@ -555,7 +555,7 @@ class EdgeMap : public IterableMapExtender > { public: - typedef StaticMappableUBipartiteGraphExtender Graph; + typedef StaticMappableBpUGraphExtender Graph; typedef IterableMapExtender > Parent; EdgeMap(const Graph& _g) @@ -583,7 +583,7 @@ class UEdgeMap : public IterableMapExtender > { public: - typedef StaticMappableUBipartiteGraphExtender Graph; + typedef StaticMappableBpUGraphExtender Graph; typedef IterableMapExtender > Parent;