COIN-OR::LEMON - Graph Library

Changeset 1026:699c7eac2c6d in lemon-main


Ignore:
Timestamp:
01/11/12 22:21:07 (13 years ago)
Author:
Balazs Dezso <deba@…>
Branch:
default
Phase:
public
Message:

Renamings in BpGraphs? (#69)

Files:
10 edited

Legend:

Unmodified
Added
Removed
  • lemon/bits/graph_extender.h

    r1025 r1026  
    914914    };
    915915
    916     class RedIt : public RedNode {
     916    class RedNodeIt : public RedNode {
    917917      const BpGraph* _graph;
    918918    public:
    919919
    920       RedIt() {}
    921 
    922       RedIt(Invalid i) : RedNode(i) { }
    923 
    924       explicit RedIt(const BpGraph& graph) : _graph(&graph) {
     920      RedNodeIt() {}
     921
     922      RedNodeIt(Invalid i) : RedNode(i) { }
     923
     924      explicit RedNodeIt(const BpGraph& graph) : _graph(&graph) {
    925925        _graph->first(static_cast<RedNode&>(*this));
    926926      }
    927927
    928       RedIt(const BpGraph& graph, const RedNode& node)
     928      RedNodeIt(const BpGraph& graph, const RedNode& node)
    929929        : RedNode(node), _graph(&graph) {}
    930930
    931       RedIt& operator++() {
     931      RedNodeIt& operator++() {
    932932        _graph->next(static_cast<RedNode&>(*this));
    933933        return *this;
     
    936936    };
    937937
    938     class BlueIt : public BlueNode {
     938    class BlueNodeIt : public BlueNode {
    939939      const BpGraph* _graph;
    940940    public:
    941941
    942       BlueIt() {}
    943 
    944       BlueIt(Invalid i) : BlueNode(i) { }
    945 
    946       explicit BlueIt(const BpGraph& graph) : _graph(&graph) {
     942      BlueNodeIt() {}
     943
     944      BlueNodeIt(Invalid i) : BlueNode(i) { }
     945
     946      explicit BlueNodeIt(const BpGraph& graph) : _graph(&graph) {
    947947        _graph->first(static_cast<BlueNode&>(*this));
    948948      }
    949949
    950       BlueIt(const BpGraph& graph, const BlueNode& node)
     950      BlueNodeIt(const BpGraph& graph, const BlueNode& node)
    951951        : BlueNode(node), _graph(&graph) {}
    952952
    953       BlueIt& operator++() {
     953      BlueNodeIt& operator++() {
    954954        _graph->next(static_cast<BlueNode&>(*this));
    955955        return *this;
     
    11451145
    11461146    template <typename _Value>
    1147     class RedMap
     1147    class RedNodeMap
    11481148      : public MapExtender<DefaultMap<BpGraph, RedNode, _Value> > {
    11491149      typedef MapExtender<DefaultMap<BpGraph, RedNode, _Value> > Parent;
    11501150
    11511151    public:
    1152       explicit RedMap(const BpGraph& bpgraph)
     1152      explicit RedNodeMap(const BpGraph& bpgraph)
    11531153        : Parent(bpgraph) {}
    1154       RedMap(const BpGraph& bpgraph, const _Value& value)
     1154      RedNodeMap(const BpGraph& bpgraph, const _Value& value)
    11551155        : Parent(bpgraph, value) {}
    11561156
    11571157    private:
    1158       RedMap& operator=(const RedMap& cmap) {
    1159         return operator=<RedMap>(cmap);
     1158      RedNodeMap& operator=(const RedNodeMap& cmap) {
     1159        return operator=<RedNodeMap>(cmap);
    11601160      }
    11611161
    11621162      template <typename CMap>
    1163       RedMap& operator=(const CMap& cmap) {
     1163      RedNodeMap& operator=(const CMap& cmap) {
    11641164        Parent::operator=(cmap);
    11651165        return *this;
     
    11691169
    11701170    template <typename _Value>
    1171     class BlueMap
     1171    class BlueNodeMap
    11721172      : public MapExtender<DefaultMap<BpGraph, BlueNode, _Value> > {
    11731173      typedef MapExtender<DefaultMap<BpGraph, BlueNode, _Value> > Parent;
    11741174
    11751175    public:
    1176       explicit BlueMap(const BpGraph& bpgraph)
     1176      explicit BlueNodeMap(const BpGraph& bpgraph)
    11771177        : Parent(bpgraph) {}
    1178       BlueMap(const BpGraph& bpgraph, const _Value& value)
     1178      BlueNodeMap(const BpGraph& bpgraph, const _Value& value)
    11791179        : Parent(bpgraph, value) {}
    11801180
    11811181    private:
    1182       BlueMap& operator=(const BlueMap& cmap) {
    1183         return operator=<BlueMap>(cmap);
     1182      BlueNodeMap& operator=(const BlueNodeMap& cmap) {
     1183        return operator=<BlueNodeMap>(cmap);
    11841184      }
    11851185
    11861186      template <typename CMap>
    1187       BlueMap& operator=(const CMap& cmap) {
     1187      BlueNodeMap& operator=(const CMap& cmap) {
    11881188        Parent::operator=(cmap);
    11891189        return *this;
  • lemon/bits/traits.h

    r1019 r1026  
    173173
    174174    typedef typename GR::RedNode Item;
    175     typedef typename GR::RedIt ItemIt;
     175    typedef typename GR::RedNodeIt ItemIt;
    176176
    177177    typedef typename RedNodeNotifierIndicator<GR>::Type ItemNotifier;
    178178
    179179    template <typename V>
    180     class Map : public GR::template RedMap<V> {
    181       typedef typename GR::template RedMap<V> Parent;
    182 
    183     public:
    184       typedef typename GR::template RedMap<V> Type;
     180    class Map : public GR::template RedNodeMap<V> {
     181      typedef typename GR::template RedNodeMap<V> Parent;
     182
     183    public:
     184      typedef typename GR::template RedNodeMap<V> Type;
    185185      typedef typename Parent::Value Value;
    186186
     
    214214
    215215    typedef typename GR::BlueNode Item;
    216     typedef typename GR::BlueIt ItemIt;
     216    typedef typename GR::BlueNodeIt ItemIt;
    217217
    218218    typedef typename BlueNodeNotifierIndicator<GR>::Type ItemNotifier;
    219219
    220220    template <typename V>
    221     class Map : public GR::template BlueMap<V> {
    222       typedef typename GR::template BlueMap<V> Parent;
    223 
    224     public:
    225       typedef typename GR::template BlueMap<V> Type;
     221    class Map : public GR::template BlueNodeMap<V> {
     222      typedef typename GR::template BlueNodeMap<V> Parent;
     223
     224    public:
     225      typedef typename GR::template BlueNodeMap<V> Type;
    226226      typedef typename Parent::Value Value;
    227227
  • lemon/concepts/bpgraph.h

    r1025 r1026  
    4949    /// "undirected graphs". Bipartite graphs provide a bipartition of
    5050    /// the node set, namely a red and blue set of the nodes. The
    51     /// nodes can be iterated with the RedIt and BlueIt in the two
    52     /// node sets. With RedMap and BlueMap values can be assigned to
    53     /// the nodes in the two sets.
     51    /// nodes can be iterated with the RedNodeIt and BlueNodeIt in the
     52    /// two node sets. With RedNodeMap and BlueNodeMap values can be
     53    /// assigned to the nodes in the two sets.
    5454    ///
    5555    /// The edges of the graph cannot connect two nodes of the same
     
    188188      /// for (BpGraph::RedNodeIt n(g); n!=INVALID; ++n) ++count;
    189189      ///\endcode
    190       class RedIt : public RedNode {
     190      class RedNodeIt : public RedNode {
    191191      public:
    192192        /// Default constructor
     
    194194        /// Default constructor.
    195195        /// \warning It sets the iterator to an undefined value.
    196         RedIt() { }
    197         /// Copy constructor.
    198 
    199         /// Copy constructor.
    200         ///
    201         RedIt(const RedIt& n) : RedNode(n) { }
     196        RedNodeIt() { }
     197        /// Copy constructor.
     198
     199        /// Copy constructor.
     200        ///
     201        RedNodeIt(const RedNodeIt& n) : RedNode(n) { }
    202202        /// %Invalid constructor \& conversion.
    203203
    204204        /// Initializes the iterator to be invalid.
    205205        /// \sa Invalid for more details.
    206         RedIt(Invalid) { }
     206        RedNodeIt(Invalid) { }
    207207        /// Sets the iterator to the first red node.
    208208
    209209        /// Sets the iterator to the first red node of the given
    210210        /// digraph.
    211         explicit RedIt(const BpGraph&) { }
     211        explicit RedNodeIt(const BpGraph&) { }
    212212        /// Sets the iterator to the given red node.
    213213
    214214        /// Sets the iterator to the given red node of the given
    215215        /// digraph.
    216         RedIt(const BpGraph&, const RedNode&) { }
     216        RedNodeIt(const BpGraph&, const RedNode&) { }
    217217        /// Next node.
    218218
    219219        /// Assign the iterator to the next red node.
    220220        ///
    221         RedIt& operator++() { return *this; }
     221        RedNodeIt& operator++() { return *this; }
    222222      };
    223223
     
    231231      /// for (BpGraph::BlueNodeIt n(g); n!=INVALID; ++n) ++count;
    232232      ///\endcode
    233       class BlueIt : public BlueNode {
     233      class BlueNodeIt : public BlueNode {
    234234      public:
    235235        /// Default constructor
     
    237237        /// Default constructor.
    238238        /// \warning It sets the iterator to an undefined value.
    239         BlueIt() { }
    240         /// Copy constructor.
    241 
    242         /// Copy constructor.
    243         ///
    244         BlueIt(const BlueIt& n) : BlueNode(n) { }
     239        BlueNodeIt() { }
     240        /// Copy constructor.
     241
     242        /// Copy constructor.
     243        ///
     244        BlueNodeIt(const BlueNodeIt& n) : BlueNode(n) { }
    245245        /// %Invalid constructor \& conversion.
    246246
    247247        /// Initializes the iterator to be invalid.
    248248        /// \sa Invalid for more details.
    249         BlueIt(Invalid) { }
     249        BlueNodeIt(Invalid) { }
    250250        /// Sets the iterator to the first blue node.
    251251
    252252        /// Sets the iterator to the first blue node of the given
    253253        /// digraph.
    254         explicit BlueIt(const BpGraph&) { }
     254        explicit BlueNodeIt(const BpGraph&) { }
    255255        /// Sets the iterator to the given blue node.
    256256
    257257        /// Sets the iterator to the given blue node of the given
    258258        /// digraph.
    259         BlueIt(const BpGraph&, const BlueNode&) { }
     259        BlueNodeIt(const BpGraph&, const BlueNode&) { }
    260260        /// Next node.
    261261
    262262        /// Assign the iterator to the next blue node.
    263263        ///
    264         BlueIt& operator++() { return *this; }
     264        BlueNodeIt& operator++() { return *this; }
    265265      };
    266266
     
    664664      /// It conforms to the ReferenceMap concept.
    665665      template<class T>
    666       class RedMap : public ReferenceMap<Node, T, T&, const T&>
     666      class RedNodeMap : public ReferenceMap<Node, T, T&, const T&>
    667667      {
    668668      public:
    669669
    670670        /// Constructor
    671         explicit RedMap(const BpGraph&) { }
     671        explicit RedNodeMap(const BpGraph&) { }
    672672        /// Constructor with given initial value
    673         RedMap(const BpGraph&, T) { }
     673        RedNodeMap(const BpGraph&, T) { }
    674674
    675675      private:
    676676        ///Copy constructor
    677         RedMap(const RedMap& nm) :
     677        RedNodeMap(const RedNodeMap& nm) :
    678678          ReferenceMap<Node, T, T&, const T&>(nm) { }
    679679        ///Assignment operator
    680680        template <typename CMap>
    681         RedMap& operator=(const CMap&) {
     681        RedNodeMap& operator=(const CMap&) {
    682682          checkConcept<ReadMap<Node, T>, CMap>();
    683683          return *this;
     
    690690      /// It conforms to the ReferenceMap concept.
    691691      template<class T>
    692       class BlueMap : public ReferenceMap<Node, T, T&, const T&>
     692      class BlueNodeMap : public ReferenceMap<Node, T, T&, const T&>
    693693      {
    694694      public:
    695695
    696696        /// Constructor
    697         explicit BlueMap(const BpGraph&) { }
     697        explicit BlueNodeMap(const BpGraph&) { }
    698698        /// Constructor with given initial value
    699         BlueMap(const BpGraph&, T) { }
     699        BlueNodeMap(const BpGraph&, T) { }
    700700
    701701      private:
    702702        ///Copy constructor
    703         BlueMap(const BlueMap& nm) :
     703        BlueNodeMap(const BlueNodeMap& nm) :
    704704          ReferenceMap<Node, T, T&, const T&>(nm) { }
    705705        ///Assignment operator
    706706        template <typename CMap>
    707         BlueMap& operator=(const CMap&) {
     707        BlueNodeMap& operator=(const CMap&) {
    708708          checkConcept<ReadMap<Node, T>, CMap>();
    709709          return *this;
  • lemon/concepts/graph_components.h

    r1025 r1026  
    12071207      ///
    12081208      /// This iterator goes through each red node.
    1209       typedef GraphItemIt<BpGraph, RedNode> RedIt;
     1209      typedef GraphItemIt<BpGraph, RedNode> RedNodeIt;
    12101210
    12111211      /// \brief This iterator goes through each blue node.
    12121212      ///
    12131213      /// This iterator goes through each blue node.
    1214       typedef GraphItemIt<BpGraph, BlueNode> BlueIt;
     1214      typedef GraphItemIt<BpGraph, BlueNode> BlueNodeIt;
    12151215
    12161216      /// @}
     
    12291229
    12301230          checkConcept<GraphItemIt<_BpGraph, typename _BpGraph::RedNode>,
    1231             typename _BpGraph::RedIt>();
     1231            typename _BpGraph::RedNodeIt>();
    12321232          checkConcept<GraphItemIt<_BpGraph, typename _BpGraph::BlueNode>,
    1233             typename _BpGraph::BlueIt>();
     1233            typename _BpGraph::BlueNodeIt>();
    12341234        }
    12351235
     
    17161716    /// bipartite graphs.  It extends \ref MappableGraphComponent with
    17171717    /// the standard graph map class for red and blue nodes (\c
    1718     /// RedMap and BlueMap). This concept is part of the BpGraph concept.
     1718    /// RedNodeMap and BlueNodeMap). This concept is part of the
     1719    /// BpGraph concept.
    17191720    template <typename BAS = BaseBpGraphComponent>
    17201721    class MappableBpGraphComponent : public MappableGraphComponent<BAS>  {
     
    17311732      /// It conforms to the ReferenceMap concept.
    17321733      template <typename V>
    1733       class RedMap : public GraphMap<MappableBpGraphComponent, Node, V> {
     1734      class RedNodeMap : public GraphMap<MappableBpGraphComponent, Node, V> {
    17341735        typedef GraphMap<MappableBpGraphComponent, Node, V> Parent;
    17351736
     
    17381739        ///
    17391740        /// Construct a new map for the graph.
    1740         explicit RedMap(const MappableBpGraphComponent& graph)
     1741        explicit RedNodeMap(const MappableBpGraphComponent& graph)
    17411742          : Parent(graph) {}
    17421743
     
    17441745        ///
    17451746        /// Construct a new map for the graph and initalize the values.
    1746         RedMap(const MappableBpGraphComponent& graph, const V& value)
     1747        RedNodeMap(const MappableBpGraphComponent& graph, const V& value)
    17471748          : Parent(graph, value) {}
    17481749
     
    17511752        ///
    17521753        /// Copy Constructor.
    1753         RedMap(const RedMap& nm) : Parent(nm) {}
     1754        RedNodeMap(const RedNodeMap& nm) : Parent(nm) {}
    17541755
    17551756        /// \brief Assignment operator.
     
    17571758        /// Assignment operator.
    17581759        template <typename CMap>
    1759         RedMap& operator=(const CMap&) {
     1760        RedNodeMap& operator=(const CMap&) {
    17601761          checkConcept<ReadMap<Node, V>, CMap>();
    17611762          return *this;
     
    17691770      /// It conforms to the ReferenceMap concept.
    17701771      template <typename V>
    1771       class BlueMap : public GraphMap<MappableBpGraphComponent, Node, V> {
     1772      class BlueNodeMap : public GraphMap<MappableBpGraphComponent, Node, V> {
    17721773        typedef GraphMap<MappableBpGraphComponent, Node, V> Parent;
    17731774
     
    17761777        ///
    17771778        /// Construct a new map for the graph.
    1778         explicit BlueMap(const MappableBpGraphComponent& graph)
     1779        explicit BlueNodeMap(const MappableBpGraphComponent& graph)
    17791780          : Parent(graph) {}
    17801781
     
    17821783        ///
    17831784        /// Construct a new map for the graph and initalize the values.
    1784         BlueMap(const MappableBpGraphComponent& graph, const V& value)
     1785        BlueNodeMap(const MappableBpGraphComponent& graph, const V& value)
    17851786          : Parent(graph, value) {}
    17861787
     
    17891790        ///
    17901791        /// Copy Constructor.
    1791         BlueMap(const BlueMap& nm) : Parent(nm) {}
     1792        BlueNodeMap(const BlueNodeMap& nm) : Parent(nm) {}
    17921793
    17931794        /// \brief Assignment operator.
     
    17951796        /// Assignment operator.
    17961797        template <typename CMap>
    1797         BlueMap& operator=(const CMap&) {
     1798        BlueNodeMap& operator=(const CMap&) {
    17981799          checkConcept<ReadMap<Node, V>, CMap>();
    17991800          return *this;
     
    18161817
    18171818          { // int map test
    1818             typedef typename _BpGraph::template RedMap<int> IntRedMap;
     1819            typedef typename _BpGraph::template RedNodeMap<int>
     1820              IntRedNodeMap;
    18191821            checkConcept<GraphMap<_BpGraph, typename _BpGraph::RedNode, int>,
    1820               IntRedMap >();
     1822              IntRedNodeMap >();
    18211823          } { // bool map test
    1822             typedef typename _BpGraph::template RedMap<bool> BoolRedMap;
     1824            typedef typename _BpGraph::template RedNodeMap<bool>
     1825              BoolRedNodeMap;
    18231826            checkConcept<GraphMap<_BpGraph, typename _BpGraph::RedNode, bool>,
    1824               BoolRedMap >();
     1827              BoolRedNodeMap >();
    18251828          } { // Dummy map test
    1826             typedef typename _BpGraph::template RedMap<Dummy> DummyRedMap;
     1829            typedef typename _BpGraph::template RedNodeMap<Dummy>
     1830              DummyRedNodeMap;
    18271831            checkConcept<GraphMap<_BpGraph, typename _BpGraph::RedNode, Dummy>,
    1828               DummyRedMap >();
     1832              DummyRedNodeMap >();
    18291833          }
    18301834
    18311835          { // int map test
    1832             typedef typename _BpGraph::template BlueMap<int> IntBlueMap;
     1836            typedef typename _BpGraph::template BlueNodeMap<int>
     1837              IntBlueNodeMap;
    18331838            checkConcept<GraphMap<_BpGraph, typename _BpGraph::BlueNode, int>,
    1834               IntBlueMap >();
     1839              IntBlueNodeMap >();
    18351840          } { // bool map test
    1836             typedef typename _BpGraph::template BlueMap<bool> BoolBlueMap;
     1841            typedef typename _BpGraph::template BlueNodeMap<bool>
     1842              BoolBlueNodeMap;
    18371843            checkConcept<GraphMap<_BpGraph, typename _BpGraph::BlueNode, bool>,
    1838               BoolBlueMap >();
     1844              BoolBlueNodeMap >();
    18391845          } { // Dummy map test
    1840             typedef typename _BpGraph::template BlueMap<Dummy> DummyBlueMap;
     1846            typedef typename _BpGraph::template BlueNodeMap<Dummy>
     1847              DummyBlueNodeMap;
    18411848            checkConcept<GraphMap<_BpGraph, typename _BpGraph::BlueNode, Dummy>,
    1842               DummyBlueMap >();
     1849              DummyBlueNodeMap >();
    18431850          }
    18441851        }
  • lemon/core.h

    r1025 r1026  
    151151  ///Create convenience typedefs for the bipartite graph types and iterators
    152152
    153   ///This \c \#define creates the same convenient type definitions as defined
    154   ///by \ref GRAPH_TYPEDEFS(BpGraph) and ten more, namely it creates
    155   ///\c RedNode, \c RedIt, \c BoolRedMap, \c IntRedMap, \c DoubleRedMap,
    156   ///\c BlueNode, \c BlueIt, \c BoolBlueMap, \c IntBlueMap, \c DoubleBlueMap.
     153  ///This \c \#define creates the same convenient type definitions as
     154  ///defined by \ref GRAPH_TYPEDEFS(BpGraph) and ten more, namely it
     155  ///creates \c RedNode, \c RedNodeIt, \c BoolRedNodeMap,
     156  ///\c IntRedNodeMap, \c DoubleRedNodeMap, \c BlueNode, \c BlueNodeIt,
     157  ///\c BoolBlueNodeMap, \c IntBlueNodeMap, \c DoubleBlueNodeMap.
    157158  ///
    158159  ///\note If the graph type is a dependent type, ie. the graph type depend
     
    162163  GRAPH_TYPEDEFS(BpGraph);                                              \
    163164  typedef BpGraph::RedNode RedNode;                                     \
    164   typedef BpGraph::RedIt RedIt;                                         \
    165   typedef BpGraph::RedMap<bool> BoolRedMap;                             \
    166   typedef BpGraph::RedMap<int> IntRedMap;                               \
    167   typedef BpGraph::RedMap<double> DoubleRedMap;                         \
     165  typedef BpGraph::RedNodeIt RedNodeIt;                                 \
     166  typedef BpGraph::RedNodeMap<bool> BoolRedNodeMap;                     \
     167  typedef BpGraph::RedNodeMap<int> IntRedNodeMap;                       \
     168  typedef BpGraph::RedNodeMap<double> DoubleRedNodeMap;                 \
    168169  typedef BpGraph::BlueNode BlueNode;                                   \
    169   typedef BpGraph::BlueIt BlueIt;                                       \
    170   typedef BpGraph::BlueMap<bool> BoolBlueMap;                           \
    171   typedef BpGraph::BlueMap<int> IntBlueMap;                             \
    172   typedef BpGraph::BlueMap<double> DoubleBlueMap
     170  typedef BpGraph::BlueNodeIt BlueNodeIt;                               \
     171  typedef BpGraph::BlueNodeMap<bool> BoolBlueNodeMap;                   \
     172  typedef BpGraph::BlueNodeMap<int> IntBlueNodeMap;                     \
     173  typedef BpGraph::BlueNodeMap<double> DoubleBlueNodeMap
    173174
    174175  ///Create convenience typedefs for the bipartite graph types and iterators
     
    178179  ///\note Use this macro, if the graph type is a dependent type,
    179180  ///ie. the graph type depend on a template parameter.
    180 #define TEMPLATE_BPGRAPH_TYPEDEFS(BpGraph)                              \
    181   TEMPLATE_GRAPH_TYPEDEFS(BpGraph);                                     \
    182   typedef typename BpGraph::RedNode RedNode;                            \
    183   typedef typename BpGraph::RedIt RedIt;                                \
    184   typedef typename BpGraph::template RedMap<bool> BoolRedMap;           \
    185   typedef typename BpGraph::template RedMap<int> IntRedMap;             \
    186   typedef typename BpGraph::template RedMap<double> DoubleRedMap;       \
    187   typedef typename BpGraph::BlueNode BlueNode;                          \
    188   typedef typename BpGraph::BlueIt BlueIt;                              \
    189   typedef typename BpGraph::template BlueMap<bool> BoolBlueMap;         \
    190   typedef typename BpGraph::template BlueMap<int> IntBlueMap;           \
    191   typedef typename BpGraph::template BlueMap<double> DoubleBlueMap
     181#define TEMPLATE_BPGRAPH_TYPEDEFS(BpGraph)                                  \
     182  TEMPLATE_GRAPH_TYPEDEFS(BpGraph);                                         \
     183  typedef typename BpGraph::RedNode RedNode;                                \
     184  typedef typename BpGraph::RedNodeIt RedNodeIt;                            \
     185  typedef typename BpGraph::template RedNodeMap<bool> BoolRedNodeMap;       \
     186  typedef typename BpGraph::template RedNodeMap<int> IntRedNodeMap;         \
     187  typedef typename BpGraph::template RedNodeMap<double> DoubleRedNodeMap;   \
     188  typedef typename BpGraph::BlueNode BlueNode;                              \
     189  typedef typename BpGraph::BlueNodeIt BlueNodeIt;                          \
     190  typedef typename BpGraph::template BlueNodeMap<bool> BoolBlueNodeMap;     \
     191  typedef typename BpGraph::template BlueNodeMap<int> IntBlueNodeMap;       \
     192  typedef typename BpGraph::template BlueNodeMap<double> DoubleBlueNodeMap
    192193
    193194  /// \brief Function to count the items in a graph.
     
    566567                       EdgeRefMap& edgeRefMap) {
    567568        to.clear();
    568         for (typename From::RedIt it(from); it != INVALID; ++it) {
     569        for (typename From::RedNodeIt it(from); it != INVALID; ++it) {
    569570          redNodeRefMap[it] = to.addRedNode();
    570571        }
    571         for (typename From::BlueIt it(from); it != INVALID; ++it) {
     572        for (typename From::BlueNodeIt it(from); it != INVALID; ++it) {
    572573          blueNodeRefMap[it] = to.addBlueNode();
    573574        }
     
    11651166  ///  NewBpGraph::EdgeMap<OrigBpGraph::Edge> ecr(new_graph);
    11661167  ///  cg.edgeCrossRef(ecr);
    1167   ///  // Copy a red map
    1168   ///  OrigBpGraph::RedMap<double> ormap(orig_graph);
    1169   ///  NewBpGraph::RedMap<double> nrmap(new_graph);
    1170   ///  cg.edgeMap(ormap, nrmap);
     1168  ///  // Copy a red node map
     1169  ///  OrigBpGraph::RedNodeMap<double> ormap(orig_graph);
     1170  ///  NewBpGraph::RedNodeMap<double> nrmap(new_graph);
     1171  ///  cg.redNodeMap(ormap, nrmap);
    11711172  ///  // Copy a node
    11721173  ///  OrigBpGraph::Node on;
     
    11951196    typedef typename To::Edge TEdge;
    11961197
    1197     typedef typename From::template RedMap<TRedNode> RedNodeRefMap;
    1198     typedef typename From::template BlueMap<TBlueNode> BlueNodeRefMap;
     1198    typedef typename From::template RedNodeMap<TRedNode> RedNodeRefMap;
     1199    typedef typename From::template BlueNodeMap<TBlueNode> BlueNodeRefMap;
    11991200    typedef typename From::template EdgeMap<TEdge> EdgeRefMap;
    12001201
     
    13531354    /// graph.
    13541355    template <typename FromMap, typename ToMap>
    1355     BpGraphCopy& redMap(const FromMap& map, ToMap& tmap) {
     1356    BpGraphCopy& redNodeMap(const FromMap& map, ToMap& tmap) {
    13561357      _red_maps.push_back(new _core_bits::MapCopy<From, RedNode,
    13571358                          RedNodeRefMap, FromMap, ToMap>(map, tmap));
     
    14041405    /// graph.
    14051406    template <typename FromMap, typename ToMap>
    1406     BpGraphCopy& blueMap(const FromMap& map, ToMap& tmap) {
     1407    BpGraphCopy& blueNodeMap(const FromMap& map, ToMap& tmap) {
    14071408      _blue_maps.push_back(new _core_bits::MapCopy<From, BlueNode,
    14081409                           BlueNodeRefMap, FromMap, ToMap>(map, tmap));
  • lemon/lgf_reader.h

    r1024 r1026  
    21492149  /// sections can contain different set of maps.
    21502150  ///
    2151   /// The red and blue maps are read from the corresponding
     2151  /// The red and blue node maps are read from the corresponding
    21522152  /// sections. If a map is defined with the same name in both of
    21532153  /// these sections, then it can be read as a node map.
     
    23382338    }
    23392339
    2340     /// Add a red map reading rule to the reader.
     2340    /// Add a red node map reading rule to the reader.
    23412341    template <typename Map>
    2342     BpGraphReader& redMap(const std::string& caption, Map& map) {
     2342    BpGraphReader& redNodeMap(const std::string& caption, Map& map) {
    23432343      checkConcept<concepts::WriteMap<Node, typename Map::Value>, Map>();
    23442344      _reader_bits::MapStorageBase<Node>* storage =
     
    23482348    }
    23492349
    2350     /// \brief Red map reading rule
    2351     ///
    2352     /// Add a red map reading rule with specialized converter to the
    2353     /// reader.
     2350    /// \brief Red node map reading rule
     2351    ///
     2352    /// Add a red node map node reading rule with specialized converter to
     2353    /// the reader.
    23542354    template <typename Map, typename Converter>
    2355     BpGraphReader& redMap(const std::string& caption, Map& map,
    2356                           const Converter& converter = Converter()) {
     2355    BpGraphReader& redNodeMap(const std::string& caption, Map& map,
     2356                              const Converter& converter = Converter()) {
    23572357      checkConcept<concepts::WriteMap<Node, typename Map::Value>, Map>();
    23582358      _reader_bits::MapStorageBase<Node>* storage =
     
    23622362    }
    23632363
    2364     /// Add a blue map reading rule to the reader.
     2364    /// Add a blue node map reading rule to the reader.
    23652365    template <typename Map>
    2366     BpGraphReader& blueMap(const std::string& caption, Map& map) {
     2366    BpGraphReader& blueNodeMap(const std::string& caption, Map& map) {
    23672367      checkConcept<concepts::WriteMap<Node, typename Map::Value>, Map>();
    23682368      _reader_bits::MapStorageBase<Node>* storage =
     
    23722372    }
    23732373
    2374     /// \brief Blue map reading rule
    2375     ///
    2376     /// Add a blue map reading rule with specialized converter to the
    2377     /// reader.
     2374    /// \brief Blue node map reading rule
     2375    ///
     2376    /// Add a blue node map reading rule with specialized converter to
     2377    /// the reader.
    23782378    template <typename Map, typename Converter>
    2379     BpGraphReader& blueMap(const std::string& caption, Map& map,
    2380                            const Converter& converter = Converter()) {
     2379    BpGraphReader& blueNodeMap(const std::string& caption, Map& map,
     2380                               const Converter& converter = Converter()) {
    23812381      checkConcept<concepts::WriteMap<Node, typename Map::Value>, Map>();
    23822382      _reader_bits::MapStorageBase<Node>* storage =
     
    26852685          if (maps.find(map) != maps.end()) {
    26862686            std::ostringstream msg;
    2687             msg << "Multiple occurence of red map: " << map;
     2687            msg << "Multiple occurence of red node map: " << map;
    26882688            throw FormatError(msg.str());
    26892689          }
     
    27782778          if (maps.find(map) != maps.end()) {
    27792779            std::ostringstream msg;
    2780             msg << "Multiple occurence of blue map: " << map;
     2780            msg << "Multiple occurence of blue node map: " << map;
    27812781            throw FormatError(msg.str());
    27822782          }
  • lemon/lgf_writer.h

    r1024 r1026  
    16301630  /// sections can contain different set of maps.
    16311631  ///
    1632   /// The red and blue maps are written to the corresponding
     1632  /// The red and blue node maps are written to the corresponding
    16331633  /// sections. The node maps are written to both of these sections
    16341634  /// with the same map name.
     
    18061806    }
    18071807
    1808     /// \brief Red map writing rule
    1809     ///
    1810     /// Add a red map writing rule to the writer.
     1808    /// \brief Red node map writing rule
     1809    ///
     1810    /// Add a red node map writing rule to the writer.
    18111811    template <typename Map>
    1812     BpGraphWriter& redMap(const std::string& caption, const Map& map) {
     1812    BpGraphWriter& redNodeMap(const std::string& caption, const Map& map) {
    18131813      checkConcept<concepts::ReadMap<Node, typename Map::Value>, Map>();
    18141814      _writer_bits::MapStorageBase<Node>* storage =
     
    18181818    }
    18191819
    1820     /// \brief Red map writing rule
    1821     ///
    1822     /// Add a red map writing rule with specialized converter to the
     1820    /// \brief Red node map writing rule
     1821    ///
     1822    /// Add a red node map writing rule with specialized converter to the
    18231823    /// writer.
    18241824    template <typename Map, typename Converter>
    1825     BpGraphWriter& redMap(const std::string& caption, const Map& map,
    1826                           const Converter& converter = Converter()) {
     1825    BpGraphWriter& redNodeMap(const std::string& caption, const Map& map,
     1826                              const Converter& converter = Converter()) {
    18271827      checkConcept<concepts::ReadMap<Node, typename Map::Value>, Map>();
    18281828      _writer_bits::MapStorageBase<Node>* storage =
     
    18321832    }
    18331833
    1834     /// \brief Blue map writing rule
    1835     ///
    1836     /// Add a blue map writing rule to the writer.
     1834    /// \brief Blue node map writing rule
     1835    ///
     1836    /// Add a blue node map writing rule to the writer.
    18371837    template <typename Map>
    1838     BpGraphWriter& blueMap(const std::string& caption, const Map& map) {
     1838    BpGraphWriter& blueNodeMap(const std::string& caption, const Map& map) {
    18391839      checkConcept<concepts::ReadMap<Node, typename Map::Value>, Map>();
    18401840      _writer_bits::MapStorageBase<Node>* storage =
     
    18441844    }
    18451845
    1846     /// \brief Blue map writing rule
    1847     ///
    1848     /// Add a blue map writing rule with specialized converter to the
     1846    /// \brief Blue node map writing rule
     1847    ///
     1848    /// Add a blue node map writing rule with specialized converter to the
    18491849    /// writer.
    18501850    template <typename Map, typename Converter>
    1851     BpGraphWriter& blueMap(const std::string& caption, const Map& map,
    1852                            const Converter& converter = Converter()) {
     1851    BpGraphWriter& blueNodeMap(const std::string& caption, const Map& map,
     1852                               const Converter& converter = Converter()) {
    18531853      checkConcept<concepts::ReadMap<Node, typename Map::Value>, Map>();
    18541854      _writer_bits::MapStorageBase<Node>* storage =
     
    20592059
    20602060      std::vector<Node> nodes;
    2061       for (RedIt n(_graph); n != INVALID; ++n) {
     2061      for (RedNodeIt n(_graph); n != INVALID; ++n) {
    20622062        nodes.push_back(n);
    20632063      }
     
    21192119
    21202120      std::vector<Node> nodes;
    2121       for (BlueIt n(_graph); n != INVALID; ++n) {
     2121      for (BlueNodeIt n(_graph); n != INVALID; ++n) {
    21222122        nodes.push_back(n);
    21232123      }
  • test/bpgraph_test.cc

    r1025 r1026  
    102102
    103103  checkGraphNodeMap(G);
    104   checkGraphRedMap(G);
    105   checkGraphBlueMap(G);
     104  checkGraphRedNodeMap(G);
     105  checkGraphBlueNodeMap(G);
    106106  checkGraphArcMap(G);
    107107  checkGraphEdgeMap(G);
     
    261261
    262262  checkGraphNodeMap(G);
    263   checkGraphRedMap(G);
    264   checkGraphBlueMap(G);
     263  checkGraphRedNodeMap(G);
     264  checkGraphBlueNodeMap(G);
    265265  checkGraphArcMap(G);
    266266  checkGraphEdgeMap(G);
     
    370370  checkGraphArcList(G, 2 * redNum * blueNum);
    371371
    372   for (RedIt n(G); n != INVALID; ++n) {
     372  for (RedNodeIt n(G); n != INVALID; ++n) {
    373373    checkGraphOutArcList(G, n, blueNum);
    374374    checkGraphInArcList(G, n, blueNum);
     
    376376  }
    377377
    378   for (BlueIt n(G); n != INVALID; ++n) {
     378  for (BlueNodeIt n(G); n != INVALID; ++n) {
    379379    checkGraphOutArcList(G, n, redNum);
    380380    checkGraphInArcList(G, n, redNum);
     
    394394
    395395  checkGraphNodeMap(G);
    396   checkGraphRedMap(G);
    397   checkGraphBlueMap(G);
     396  checkGraphRedNodeMap(G);
     397  checkGraphBlueNodeMap(G);
    398398  checkGraphArcMap(G);
    399399  checkGraphEdgeMap(G);
  • test/graph_copy_test.cc

    r1025 r1026  
    217217  SmartBpGraph from;
    218218  SmartBpGraph::NodeMap<int> fnm(from);
    219   SmartBpGraph::RedMap<int> frnm(from);
    220   SmartBpGraph::BlueMap<int> fbnm(from);
     219  SmartBpGraph::RedNodeMap<int> frnm(from);
     220  SmartBpGraph::BlueNodeMap<int> fbnm(from);
    221221  SmartBpGraph::ArcMap<int> fam(from);
    222222  SmartBpGraph::EdgeMap<int> fem(from);
     
    262262  GR to;
    263263  typename GR::template NodeMap<int> tnm(to);
    264   typename GR::template RedMap<int> trnm(to);
    265   typename GR::template BlueMap<int> tbnm(to);
     264  typename GR::template RedNodeMap<int> trnm(to);
     265  typename GR::template BlueNodeMap<int> tbnm(to);
    266266  typename GR::template ArcMap<int> tam(to);
    267267  typename GR::template EdgeMap<int> tem(to);
     
    273273
    274274  SmartBpGraph::NodeMap<typename GR::Node> nr(from);
    275   SmartBpGraph::RedMap<typename GR::RedNode> rnr(from);
    276   SmartBpGraph::BlueMap<typename GR::BlueNode> bnr(from);
     275  SmartBpGraph::RedNodeMap<typename GR::RedNode> rnr(from);
     276  SmartBpGraph::BlueNodeMap<typename GR::BlueNode> bnr(from);
    277277  SmartBpGraph::ArcMap<typename GR::Arc> ar(from);
    278278  SmartBpGraph::EdgeMap<typename GR::Edge> er(from);
    279279
    280280  typename GR::template NodeMap<SmartBpGraph::Node> ncr(to);
    281   typename GR::template RedMap<SmartBpGraph::RedNode> rncr(to);
    282   typename GR::template BlueMap<SmartBpGraph::BlueNode> bncr(to);
     281  typename GR::template RedNodeMap<SmartBpGraph::RedNode> rncr(to);
     282  typename GR::template BlueNodeMap<SmartBpGraph::BlueNode> bncr(to);
    283283  typename GR::template ArcMap<SmartBpGraph::Arc> acr(to);
    284284  typename GR::template EdgeMap<SmartBpGraph::Edge> ecr(to);
    285285
    286286  bpGraphCopy(from, to).
    287     nodeMap(fnm, tnm).redMap(frnm, trnm).blueMap(fbnm, tbnm).
     287    nodeMap(fnm, tnm).
     288    redNodeMap(frnm, trnm).blueNodeMap(fbnm, tbnm).
    288289    arcMap(fam, tam).edgeMap(fem, tem).
    289290    nodeRef(nr).redRef(rnr).blueRef(bnr).
     
    305306  }
    306307
    307   for (SmartBpGraph::RedIt it(from); it != INVALID; ++it) {
     308  for (SmartBpGraph::RedNodeIt it(from); it != INVALID; ++it) {
    308309    check(ncr[nr[it]] == it, "Wrong copy.");
    309310    check(fnm[it] == tnm[nr[it]], "Wrong copy.");
     
    314315  }
    315316
    316   for (SmartBpGraph::BlueIt it(from); it != INVALID; ++it) {
     317  for (SmartBpGraph::BlueNodeIt it(from); it != INVALID; ++it) {
    317318    check(ncr[nr[it]] == it, "Wrong copy.");
    318319    check(fnm[it] == tnm[nr[it]], "Wrong copy.");
     
    344345    check(nr[ncr[it]] == it, "Wrong copy.");
    345346  }
    346   for (typename GR::RedIt it(to); it != INVALID; ++it) {
     347  for (typename GR::RedNodeIt it(to); it != INVALID; ++it) {
    347348    check(rncr[it] == ncr[it], "Wrong copy.");
    348349    check(rnr[rncr[it]] == it, "Wrong copy.");
    349350  }
    350   for (typename GR::BlueIt it(to); it != INVALID; ++it) {
     351  for (typename GR::BlueNodeIt it(to); it != INVALID; ++it) {
    351352    check(bncr[it] == ncr[it], "Wrong copy.");
    352353    check(bnr[bncr[it]] == it, "Wrong copy.");
  • test/graph_test.h

    r1025 r1026  
    4444  void checkGraphRedNodeList(const Graph &G, int cnt)
    4545  {
    46     typename Graph::RedIt n(G);
     46    typename Graph::RedNodeIt n(G);
    4747    for(int i=0;i<cnt;i++) {
    4848      check(n!=INVALID,"Wrong red Node list linking.");
     
    6666  void checkGraphBlueNodeList(const Graph &G, int cnt)
    6767  {
    68     typename Graph::BlueIt n(G);
     68    typename Graph::BlueNodeIt n(G);
    6969    for(int i=0;i<cnt;i++) {
    7070      check(n!=INVALID,"Wrong blue Node list linking.");
     
    226226    typedef typename Graph::RedNode RedNode;
    227227    std::set<int> values;
    228     for (typename Graph::RedIt n(G); n != INVALID; ++n) {
     228    for (typename Graph::RedNodeIt n(G); n != INVALID; ++n) {
    229229      check(G.red(n), "Wrong partition");
    230230      check(values.find(G.id(n)) == values.end(), "Wrong id");
     
    239239    typedef typename Graph::BlueNode BlueNode;
    240240    std::set<int> values;
    241     for (typename Graph::BlueIt n(G); n != INVALID; ++n) {
     241    for (typename Graph::BlueNodeIt n(G); n != INVALID; ++n) {
    242242      check(G.blue(n), "Wrong partition");
    243243      check(values.find(G.id(n)) == values.end(), "Wrong id");
     
    305305
    306306  template <typename Graph>
    307   void checkGraphRedMap(const Graph& G) {
     307  void checkGraphRedNodeMap(const Graph& G) {
    308308    typedef typename Graph::Node Node;
    309     typedef typename Graph::RedIt RedIt;
    310 
    311     typedef typename Graph::template RedMap<int> IntRedMap;
    312     IntRedMap map(G, 42);
    313     for (RedIt it(G); it != INVALID; ++it) {
     309    typedef typename Graph::RedNodeIt RedNodeIt;
     310
     311    typedef typename Graph::template RedNodeMap<int> IntRedNodeMap;
     312    IntRedNodeMap map(G, 42);
     313    for (RedNodeIt it(G); it != INVALID; ++it) {
    314314      check(map[it] == 42, "Wrong map constructor.");
    315315    }
    316316    int s = 0;
    317     for (RedIt it(G); it != INVALID; ++it) {
     317    for (RedNodeIt it(G); it != INVALID; ++it) {
    318318      map[it] = 0;
    319319      check(map[it] == 0, "Wrong operator[].");
     
    323323    }
    324324    s = s * (s - 1) / 2;
    325     for (RedIt it(G); it != INVALID; ++it) {
     325    for (RedNodeIt it(G); it != INVALID; ++it) {
    326326      s -= map[it];
    327327    }
     
    335335
    336336  template <typename Graph>
    337   void checkGraphBlueMap(const Graph& G) {
     337  void checkGraphBlueNodeMap(const Graph& G) {
    338338    typedef typename Graph::Node Node;
    339     typedef typename Graph::BlueIt BlueIt;
    340 
    341     typedef typename Graph::template BlueMap<int> IntBlueMap;
    342     IntBlueMap map(G, 42);
    343     for (BlueIt it(G); it != INVALID; ++it) {
     339    typedef typename Graph::BlueNodeIt BlueNodeIt;
     340
     341    typedef typename Graph::template BlueNodeMap<int> IntBlueNodeMap;
     342    IntBlueNodeMap map(G, 42);
     343    for (BlueNodeIt it(G); it != INVALID; ++it) {
    344344      check(map[it] == 42, "Wrong map constructor.");
    345345    }
    346346    int s = 0;
    347     for (BlueIt it(G); it != INVALID; ++it) {
     347    for (BlueNodeIt it(G); it != INVALID; ++it) {
    348348      map[it] = 0;
    349349      check(map[it] == 0, "Wrong operator[].");
     
    353353    }
    354354    s = s * (s - 1) / 2;
    355     for (BlueIt it(G); it != INVALID; ++it) {
     355    for (BlueNodeIt it(G); it != INVALID; ++it) {
    356356      s -= map[it];
    357357    }
Note: See TracChangeset for help on using the changeset viewer.