COIN-OR::LEMON - Graph Library

Changeset 1026:699c7eac2c6d in lemon-main for lemon/concepts


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

Renamings in BpGraphs? (#69)

Location:
lemon/concepts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 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        }
Note: See TracChangeset for help on using the changeset viewer.