[Lemon-commits] Balazs Dezso: Renamings in BpGraphs (#69)

Lemon HG hg at lemon.cs.elte.hu
Fri Mar 1 17:49:47 CET 2013


details:   http://lemon.cs.elte.hu/hg/lemon/rev/699c7eac2c6d
changeset: 1194:699c7eac2c6d
user:      Balazs Dezso <deba [at] inf.elte.hu>
date:      Wed Jan 11 22:21:07 2012 +0100
description:
	Renamings in BpGraphs (#69)
	 - RedIt->RedNodeIt
	 - BlueIt->BlueNodeIt
	 - RedMap->RedNodeMap
	 - BlueMap->BlueNodeMap

diffstat:

 lemon/bits/graph_extender.h       |  48 +++++++++++++-------------
 lemon/bits/traits.h               |  16 ++++----
 lemon/concepts/bpgraph.h          |  54 +++++++++++++++---------------
 lemon/concepts/graph_components.h |  61 +++++++++++++++++++---------------
 lemon/core.h                      |  69 +++++++++++++++++++-------------------
 lemon/lgf_reader.h                |  34 +++++++++---------
 lemon/lgf_writer.h                |  34 +++++++++---------
 test/bpgraph_test.cc              |  16 ++++----
 test/graph_copy_test.cc           |  27 +++++++-------
 test/graph_test.h                 |  36 ++++++++++----------
 10 files changed, 202 insertions(+), 193 deletions(-)

diffs (truncated from 1056 to 300 lines):

diff --git a/lemon/bits/graph_extender.h b/lemon/bits/graph_extender.h
--- a/lemon/bits/graph_extender.h
+++ b/lemon/bits/graph_extender.h
@@ -913,44 +913,44 @@
 
     };
 
-    class RedIt : public RedNode {
+    class RedNodeIt : public RedNode {
       const BpGraph* _graph;
     public:
 
-      RedIt() {}
+      RedNodeIt() {}
 
-      RedIt(Invalid i) : RedNode(i) { }
+      RedNodeIt(Invalid i) : RedNode(i) { }
 
-      explicit RedIt(const BpGraph& graph) : _graph(&graph) {
+      explicit RedNodeIt(const BpGraph& graph) : _graph(&graph) {
         _graph->first(static_cast<RedNode&>(*this));
       }
 
-      RedIt(const BpGraph& graph, const RedNode& node)
+      RedNodeIt(const BpGraph& graph, const RedNode& node)
         : RedNode(node), _graph(&graph) {}
 
-      RedIt& operator++() {
+      RedNodeIt& operator++() {
         _graph->next(static_cast<RedNode&>(*this));
         return *this;
       }
 
     };
 
-    class BlueIt : public BlueNode {
+    class BlueNodeIt : public BlueNode {
       const BpGraph* _graph;
     public:
 
-      BlueIt() {}
+      BlueNodeIt() {}
 
-      BlueIt(Invalid i) : BlueNode(i) { }
+      BlueNodeIt(Invalid i) : BlueNode(i) { }
 
-      explicit BlueIt(const BpGraph& graph) : _graph(&graph) {
+      explicit BlueNodeIt(const BpGraph& graph) : _graph(&graph) {
         _graph->first(static_cast<BlueNode&>(*this));
       }
 
-      BlueIt(const BpGraph& graph, const BlueNode& node)
+      BlueNodeIt(const BpGraph& graph, const BlueNode& node)
         : BlueNode(node), _graph(&graph) {}
 
-      BlueIt& operator++() {
+      BlueNodeIt& operator++() {
         _graph->next(static_cast<BlueNode&>(*this));
         return *this;
       }
@@ -1144,23 +1144,23 @@
     };
 
     template <typename _Value>
-    class RedMap
+    class RedNodeMap
       : public MapExtender<DefaultMap<BpGraph, RedNode, _Value> > {
       typedef MapExtender<DefaultMap<BpGraph, RedNode, _Value> > Parent;
 
     public:
-      explicit RedMap(const BpGraph& bpgraph)
+      explicit RedNodeMap(const BpGraph& bpgraph)
         : Parent(bpgraph) {}
-      RedMap(const BpGraph& bpgraph, const _Value& value)
+      RedNodeMap(const BpGraph& bpgraph, const _Value& value)
         : Parent(bpgraph, value) {}
 
     private:
-      RedMap& operator=(const RedMap& cmap) {
-        return operator=<RedMap>(cmap);
+      RedNodeMap& operator=(const RedNodeMap& cmap) {
+        return operator=<RedNodeMap>(cmap);
       }
 
       template <typename CMap>
-      RedMap& operator=(const CMap& cmap) {
+      RedNodeMap& operator=(const CMap& cmap) {
         Parent::operator=(cmap);
         return *this;
       }
@@ -1168,23 +1168,23 @@
     };
 
     template <typename _Value>
-    class BlueMap
+    class BlueNodeMap
       : public MapExtender<DefaultMap<BpGraph, BlueNode, _Value> > {
       typedef MapExtender<DefaultMap<BpGraph, BlueNode, _Value> > Parent;
 
     public:
-      explicit BlueMap(const BpGraph& bpgraph)
+      explicit BlueNodeMap(const BpGraph& bpgraph)
         : Parent(bpgraph) {}
-      BlueMap(const BpGraph& bpgraph, const _Value& value)
+      BlueNodeMap(const BpGraph& bpgraph, const _Value& value)
         : Parent(bpgraph, value) {}
 
     private:
-      BlueMap& operator=(const BlueMap& cmap) {
-        return operator=<BlueMap>(cmap);
+      BlueNodeMap& operator=(const BlueNodeMap& cmap) {
+        return operator=<BlueNodeMap>(cmap);
       }
 
       template <typename CMap>
-      BlueMap& operator=(const CMap& cmap) {
+      BlueNodeMap& operator=(const CMap& cmap) {
         Parent::operator=(cmap);
         return *this;
       }
diff --git a/lemon/bits/traits.h b/lemon/bits/traits.h
--- a/lemon/bits/traits.h
+++ b/lemon/bits/traits.h
@@ -172,16 +172,16 @@
     typedef GR Digraph;
 
     typedef typename GR::RedNode Item;
-    typedef typename GR::RedIt ItemIt;
+    typedef typename GR::RedNodeIt ItemIt;
 
     typedef typename RedNodeNotifierIndicator<GR>::Type ItemNotifier;
 
     template <typename V>
-    class Map : public GR::template RedMap<V> {
-      typedef typename GR::template RedMap<V> Parent;
+    class Map : public GR::template RedNodeMap<V> {
+      typedef typename GR::template RedNodeMap<V> Parent;
 
     public:
-      typedef typename GR::template RedMap<V> Type;
+      typedef typename GR::template RedNodeMap<V> Type;
       typedef typename Parent::Value Value;
 
       Map(const GR& _bpgraph) : Parent(_bpgraph) {}
@@ -213,16 +213,16 @@
     typedef GR Digraph;
 
     typedef typename GR::BlueNode Item;
-    typedef typename GR::BlueIt ItemIt;
+    typedef typename GR::BlueNodeIt ItemIt;
 
     typedef typename BlueNodeNotifierIndicator<GR>::Type ItemNotifier;
 
     template <typename V>
-    class Map : public GR::template BlueMap<V> {
-      typedef typename GR::template BlueMap<V> Parent;
+    class Map : public GR::template BlueNodeMap<V> {
+      typedef typename GR::template BlueNodeMap<V> Parent;
 
     public:
-      typedef typename GR::template BlueMap<V> Type;
+      typedef typename GR::template BlueNodeMap<V> Type;
       typedef typename Parent::Value Value;
 
       Map(const GR& _bpgraph) : Parent(_bpgraph) {}
diff --git a/lemon/concepts/bpgraph.h b/lemon/concepts/bpgraph.h
--- a/lemon/concepts/bpgraph.h
+++ b/lemon/concepts/bpgraph.h
@@ -48,9 +48,9 @@
     /// The bipartite graphs also fulfill the concept of \ref Graph
     /// "undirected graphs". Bipartite graphs provide a bipartition of
     /// the node set, namely a red and blue set of the nodes. The
-    /// nodes can be iterated with the RedIt and BlueIt in the two
-    /// node sets. With RedMap and BlueMap values can be assigned to
-    /// the nodes in the two sets.
+    /// nodes can be iterated with the RedNodeIt and BlueNodeIt in the
+    /// two node sets. With RedNodeMap and BlueNodeMap values can be
+    /// assigned to the nodes in the two sets.
     ///
     /// The edges of the graph cannot connect two nodes of the same
     /// set. The edges inherent orientation is from the red nodes to
@@ -187,38 +187,38 @@
       /// int count=0;
       /// for (BpGraph::RedNodeIt n(g); n!=INVALID; ++n) ++count;
       ///\endcode
-      class RedIt : public RedNode {
+      class RedNodeIt : public RedNode {
       public:
         /// Default constructor
 
         /// Default constructor.
         /// \warning It sets the iterator to an undefined value.
-        RedIt() { }
+        RedNodeIt() { }
         /// Copy constructor.
 
         /// Copy constructor.
         ///
-        RedIt(const RedIt& n) : RedNode(n) { }
+        RedNodeIt(const RedNodeIt& n) : RedNode(n) { }
         /// %Invalid constructor \& conversion.
 
         /// Initializes the iterator to be invalid.
         /// \sa Invalid for more details.
-        RedIt(Invalid) { }
+        RedNodeIt(Invalid) { }
         /// Sets the iterator to the first red node.
 
         /// Sets the iterator to the first red node of the given
         /// digraph.
-        explicit RedIt(const BpGraph&) { }
+        explicit RedNodeIt(const BpGraph&) { }
         /// Sets the iterator to the given red node.
 
         /// Sets the iterator to the given red node of the given
         /// digraph.
-        RedIt(const BpGraph&, const RedNode&) { }
+        RedNodeIt(const BpGraph&, const RedNode&) { }
         /// Next node.
 
         /// Assign the iterator to the next red node.
         ///
-        RedIt& operator++() { return *this; }
+        RedNodeIt& operator++() { return *this; }
       };
 
       /// Iterator class for the blue nodes.
@@ -230,38 +230,38 @@
       /// int count=0;
       /// for (BpGraph::BlueNodeIt n(g); n!=INVALID; ++n) ++count;
       ///\endcode
-      class BlueIt : public BlueNode {
+      class BlueNodeIt : public BlueNode {
       public:
         /// Default constructor
 
         /// Default constructor.
         /// \warning It sets the iterator to an undefined value.
-        BlueIt() { }
+        BlueNodeIt() { }
         /// Copy constructor.
 
         /// Copy constructor.
         ///
-        BlueIt(const BlueIt& n) : BlueNode(n) { }
+        BlueNodeIt(const BlueNodeIt& n) : BlueNode(n) { }
         /// %Invalid constructor \& conversion.
 
         /// Initializes the iterator to be invalid.
         /// \sa Invalid for more details.
-        BlueIt(Invalid) { }
+        BlueNodeIt(Invalid) { }
         /// Sets the iterator to the first blue node.
 
         /// Sets the iterator to the first blue node of the given
         /// digraph.
-        explicit BlueIt(const BpGraph&) { }
+        explicit BlueNodeIt(const BpGraph&) { }
         /// Sets the iterator to the given blue node.
 
         /// Sets the iterator to the given blue node of the given
         /// digraph.
-        BlueIt(const BpGraph&, const BlueNode&) { }
+        BlueNodeIt(const BpGraph&, const BlueNode&) { }
         /// Next node.
 
         /// Assign the iterator to the next blue node.
         ///
-        BlueIt& operator++() { return *this; }
+        BlueNodeIt& operator++() { return *this; }
       };
 
       /// Iterator class for the nodes.
@@ -663,22 +663,22 @@
       /// Standard graph map type for the red nodes.
       /// It conforms to the ReferenceMap concept.
       template<class T>
-      class RedMap : public ReferenceMap<Node, T, T&, const T&>
+      class RedNodeMap : public ReferenceMap<Node, T, T&, const T&>
       {
       public:
 
         /// Constructor
-        explicit RedMap(const BpGraph&) { }
+        explicit RedNodeMap(const BpGraph&) { }
         /// Constructor with given initial value
-        RedMap(const BpGraph&, T) { }
+        RedNodeMap(const BpGraph&, T) { }
 
       private:
         ///Copy constructor
-        RedMap(const RedMap& nm) :
+        RedNodeMap(const RedNodeMap& nm) :
           ReferenceMap<Node, T, T&, const T&>(nm) { }
         ///Assignment operator
         template <typename CMap>
-        RedMap& operator=(const CMap&) {
+        RedNodeMap& operator=(const CMap&) {
           checkConcept<ReadMap<Node, T>, CMap>();
           return *this;



More information about the Lemon-commits mailing list