COIN-OR::LEMON - Graph Library

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

    r1999 r2031  
    2424#include <lemon/bits/traits.h>
    2525#include <lemon/bits/alteration_notifier.h>
     26#include <lemon/concept_check.h>
     27#include <lemon/concept/maps.h>
    2628
    2729/// \ingroup graphbits
     
    120122    }
    121123
     124    /// \brief Assign operator.
     125    ///
     126    /// This operator assigns for each item in the map the
     127    /// value mapped to the same item in the copied map. 
     128    /// The parameter map should be indiced with the same
     129    /// itemset because this assign operator does not change
     130    /// the container of the map.
     131    ArrayMap& operator=(const ArrayMap& cmap) {
     132      return operator=<ArrayMap>(cmap);
     133    }
     134
     135
     136    /// \brief Template assign operator.
     137    ///
     138    /// The given parameter should be conform to the ReadMap
     139    /// concecpt and could be indiced by the current item set of
     140    /// the NodeMap. In this case the value for each item
     141    /// is assigned by the value of the given ReadMap.
     142    template <typename CMap>
     143    ArrayMap& operator=(const CMap& cmap) {
     144      checkConcept<concept::ReadMap<Key, _Value>, CMap>();
     145      const typename Parent::Notifier* notifier = Parent::getNotifier();
     146      Item it;
     147      for (notifier->first(it); it != INVALID; notifier->next(it)) {
     148        set(it, cmap[it]);
     149      }
     150      return *this;
     151    }
     152
    122153    /// \brief The destructor of the map.
    123154    ///     
     
    130161    }
    131162               
    132   private:
    133 
    134     ArrayMap& operator=(const ArrayMap&);
    135 
    136163  protected:
    137164
Note: See TracChangeset for help on using the changeset viewer.