COIN-OR::LEMON - Graph Library

Changeset 2031:080d51024ac5 in lemon-0.x for lemon/edge_set.h


Ignore:
Timestamp:
04/03/06 11:45:23 (18 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2670
Message:

Correcting the structure of the graph's and adaptor's map.
The template assign operators and map iterators can be used for adaptors also.

Some bugfix in the adaptors

New class SwapBpUGraphAdaptor which swaps the two nodeset of the graph.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/edge_set.h

    r1999 r2031  
    207207    class NodeMap : public Graph::template NodeMap<_Value> {
    208208    public:
     209
    209210      typedef typename _Graph::template NodeMap<_Value> Parent;
     211
    210212      explicit NodeMap(const ListEdgeSetBase<Graph>& edgeset)
    211         : Parent(*edgeset.graph) { }
     213        : Parent(*edgeset.graph) {}
     214
    212215      NodeMap(const ListEdgeSetBase<Graph>& edgeset, const _Value& value)
    213         : Parent(*edgeset.graph, value) { }
     216        : Parent(*edgeset.graph, value) {}
     217
     218      NodeMap& operator=(const NodeMap& cmap) {
     219        return operator=<NodeMap>(cmap);
     220      }
     221
     222      template <typename CMap>
     223      NodeMap& operator=(const CMap& cmap) {
     224        Parent::operator=(cmap);
     225        return *this;
     226      }
    214227    };
    215228
     
    522535    class NodeMap : public Graph::template NodeMap<_Value> {
    523536    public:
     537
    524538      typedef typename _Graph::template NodeMap<_Value> Parent;
     539
    525540      explicit NodeMap(const SmartEdgeSetBase<Graph>& edgeset)
    526541        : Parent(*edgeset.graph) { }
     542
    527543      NodeMap(const SmartEdgeSetBase<Graph>& edgeset, const _Value& value)
    528544        : Parent(*edgeset.graph, value) { }
     545
     546      NodeMap& operator=(const NodeMap& cmap) {
     547        return operator=<NodeMap>(cmap);
     548      }
     549
     550      template <typename CMap>
     551      NodeMap& operator=(const CMap& cmap) {
     552        Parent::operator=(cmap);
     553        return *this;
     554      }
    529555    };
    530556
     
    668694
    669695    void eraseNode(const Node& node) {
    670       if (Parent::IncEdgeIt(*this, node) == INVALID) {
     696      if (typename Parent::IncEdgeIt(*this, node) == INVALID) {
    671697        return;
    672698      }
Note: See TracChangeset for help on using the changeset viewer.