COIN-OR::LEMON - Graph Library

Changeset 2031:080d51024ac5 in lemon-0.x for lemon/bits/vector_map.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/bits/vector_map.h

    r1999 r2031  
    2727
    2828#include <lemon/bits/alteration_notifier.h>
     29
     30#include <lemon/concept_check.h>
     31#include <lemon/concept/maps.h>
    2932
    3033///\ingroup graphbits
     
    113116    }
    114117
    115   private:
    116 
    117     VectorMap& operator=(const VectorMap&);
    118 
     118    /// \brief Assign operator.
     119    ///
     120    /// This operator assigns for each item in the map the
     121    /// value mapped to the same item in the copied map. 
     122    /// The parameter map should be indiced with the same
     123    /// itemset because this assign operator does not change
     124    /// the container of the map.
     125    VectorMap& operator=(const VectorMap& cmap) {
     126      return operator=<VectorMap>(cmap);
     127    }
     128
     129
     130    /// \brief Template assign operator.
     131    ///
     132    /// The given parameter should be conform to the ReadMap
     133    /// concecpt and could be indiced by the current item set of
     134    /// the NodeMap. In this case the value for each item
     135    /// is assigned by the value of the given ReadMap.
     136    template <typename CMap>
     137    VectorMap& operator=(const CMap& cmap) {
     138      checkConcept<concept::ReadMap<Key, _Value>, CMap>();
     139      const typename Parent::Notifier* notifier = Parent::getNotifier();
     140      Item it;
     141      for (notifier->first(it); it != INVALID; notifier->next(it)) {
     142        set(it, cmap[it]);
     143      }
     144      return *this;
     145    }
     146   
    119147  public:
    120148
Note: See TracChangeset for help on using the changeset viewer.