COIN-OR::LEMON - Graph Library

Changeset 891:74589d20dbc3 in lemon-0.x for src/hugo


Ignore:
Timestamp:
09/21/04 00:57:48 (20 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1199
Message:

template<typename CMap> Map(const CMap&) like constructors and
assigns are removed.

Location:
src/hugo
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • src/hugo/array_map.h

    r844 r891  
    6666    /** Default constructor for the map.
    6767     */
    68     ArrayMap() : values(0), capacity(0) {}
     68    ArrayMap() : capacity(0), values(0) {}
    6969                       
    7070    /** Graph and Registry initialized map constructor.
     
    9191    /** Constructor to copy a map of the same map type.
    9292     */
    93     ArrayMap(const ArrayMap& copy) : MapBase(*copy.graph, *copy.registry) {
     93    ArrayMap(const ArrayMap& copy) : MapBase(copy) {
    9494      capacity = copy.capacity;
    9595      if (capacity == 0) return;
     
    103103    /** Constructor to copy a map of an other map type.
    104104     */
    105     template <typename CMap> ArrayMap(const CMap& copy)
    106       : MapBase(copy), capacity(0), values(0) {
    107       if (MapBase::getGraph()) {
    108         allocate_memory();
    109         for (KeyIt it(*MapBase::getGraph()); it != INVALID; ++it) {
    110           set(it, copy[it]);
    111         }
     105    template <typename TT>
     106    ArrayMap(const ArrayMap<MapRegistry, TT>& copy)
     107      : MapBase(copy) {
     108      capacity = copy.capacity;
     109      if (capacity == 0) return;
     110      values = allocator.allocate(capacity);
     111      for (KeyIt it(*MapBase::getGraph()); it != INVALID; ++it) {
     112        int id = KeyInfo<Graph, KeyIt>::id(*MapBase::getGraph(), it);
     113        allocator.construct(&(values[id]), copy.values[id]);
    112114      }
    113115    }
     
    117119    ArrayMap& operator=(const ArrayMap& copy) {
    118120      if (&copy == this) return *this;
     121
    119122      if (capacity != 0) {
    120123        MapBase::destroy();
    121124        allocator.deallocate(values, capacity);
    122125      }
     126
     127      MapBase::operator=(copy);
     128
    123129      capacity = copy.capacity;
    124130      if (capacity == 0) return *this;
    125131      values = allocator.allocate(capacity);
     132
    126133      for (KeyIt it(*MapBase::getGraph()); it != INVALID; ++it) {
    127134        int id = KeyInfo<Graph, KeyIt>::id(*MapBase::getGraph(), it);
    128135        allocator.construct(&(values[id]), copy.values[id]);
    129136      }
     137
    130138      return *this;
    131139    }
    132140
    133     /** Assign operator to copy a map an other map type.
    134      */
    135     template <typename CMap> ArrayMap& operator=(const CMap& copy) {
     141    /** Assign operator to copy a map of an other map type.
     142     */
     143    template <typename TT>
     144    ArrayMap& operator=(const ArrayMap<MapRegistry, TT>& copy) {
    136145      if (capacity != 0) {
    137146        MapBase::destroy();
    138147        allocator.deallocate(values, capacity);
    139148      }
     149
    140150      MapBase::operator=(copy);
    141       if (MapBase::getGraph()) {
    142         allocate_memory();
    143         for (KeyIt it(*MapBase::getGraph()); it != INVALID; ++it) {
    144           set(it, copy[it]);
    145         }
    146       }
     151
     152      capacity = copy.capacity;
     153      if (capacity == 0) return *this;
     154      values = allocator.allocate(capacity);
     155
     156      for (KeyIt it(*MapBase::getGraph()); it != INVALID; ++it) {
     157        int id = KeyInfo<Graph, KeyIt>::id(*MapBase::getGraph(), it);
     158        allocator.construct(&(values[id]), copy.values[id]);
     159      }
     160
    147161      return *this;
    148162    }
  • src/hugo/default_map.h

    r822 r891  
    3030   */
    3131#define DEFAULT_MAP_BODY(DynMap, Value) \
    32   { \
    33     typedef DynMap<MapRegistry, Value> MapImpl; \
    34   \
    35   public: \
    36   \
    37     typedef typename MapRegistry::Graph Graph; \
    38   \
    39     DefaultMap() : MapImpl() {} \
    40   \
    41     DefaultMap(const Graph& g, MapRegistry& r) : MapImpl(g, r) {} \
    42   \
    43     DefaultMap(const Graph& g, MapRegistry& r, const Value& v) \
    44       : MapImpl(g, r, v) {} \
    45   \
    46     DefaultMap(const DefaultMap& copy) \
    47       : MapImpl(static_cast<const MapImpl&>(copy)) {} \
    48   \
    49     template <typename CMap> DefaultMap(const CMap& copy) : MapImpl(copy) {} \
    50   \
    51     DefaultMap& operator=(const DefaultMap& copy) { \
    52       MapImpl::operator=(static_cast<const MapImpl&>(copy)); \
    53       return *this; \
     32{ \
     33\
     34public: \
     35\
     36typedef DynMap<MapRegistry, Value> Parent; \
     37\
     38typedef typename MapRegistry::Graph Graph; \
     39\
     40DefaultMap() : Parent() {} \
     41DefaultMap(const Graph& g, MapRegistry& r) : Parent(g, r) {} \
     42DefaultMap(const Graph& g, MapRegistry& r, const Value& v) \
     43  : Parent(g, r, v) {} \
     44DefaultMap(const DefaultMap& copy) \
     45  : Parent(static_cast<const Parent&>(copy)) {} \
     46template <typename TT> \
     47DefaultMap(const DefaultMap<MapRegistry, TT>& copy) { \
     48  Parent::MapBase::operator= \
     49    (static_cast<const typename Parent::MapBase&>(copy)); \
     50  if (Parent::getGraph()) { \
     51    for (typename Parent::KeyIt it(*Parent::getGraph()); it!=INVALID; ++it) {\
     52      Parent::add(it); \
     53      Parent::operator[](it) = copy[it]; \
    5454    } \
    55   \
    56     template <typename CMap> DefaultMap& operator=(const CMap& copy) { \
    57       MapImpl::operator=(copy); \
    58       return *this; \
     55  } \
     56} \
     57DefaultMap& operator=(const DefaultMap& copy) { \
     58  Parent::operator=(static_cast<const Parent&>(copy)); \
     59  return *this; \
     60} \
     61template <typename TT> \
     62DefaultMap& operator=(const DefaultMap<MapRegistry, TT>& copy) { \
     63  Parent::clear(); \
     64  Parent::MapBase::operator=(copy); \
     65  if (Parent::getGraph()) { \
     66    for (typename Parent::KeyIt it(*Parent::getGraph()); it!=INVALID; ++it) {\
     67      Parent::add(it); \
     68      Parent::operator[](it) = copy[it]; \
    5969    } \
    60   \
    61   };
     70  } \
     71  return *this; \
     72} \
     73};
    6274
    6375
  • src/hugo/graph_wrapper.h

    r888 r891  
    287287      return GraphWrapper<Graph>::tail(e); }
    288288
    289     KEEP_MAPS(Parent, RevGraphWrapper);
     289    //    KEEP_MAPS(Parent, RevGraphWrapper);
    290290
    291291  };
     
    494494    }
    495495
    496     KEEP_MAPS(Parent, SubGraphWrapper);
     496    //    KEEP_MAPS(Parent, SubGraphWrapper);
    497497  };
    498498
     
    559559        return this->graph->tail(e); }
    560560
    561     KEEP_MAPS(Parent, UndirGraphWrapper);
     561    //    KEEP_MAPS(Parent, UndirGraphWrapper);
    562562
    563563  };
     
    566566  ///
    567567  ///\warning Graph wrappers are in even more experimental state than the other
    568   ///parts of the lib. Use them at you own risk.
     568  ///parts of the lib. Use them at your own risk.
    569569  ///
    570570  /// An undirected graph template.
     
    582582    }
    583583
    584     KEEP_MAPS(Parent, UndirGraph);
     584    //    KEEP_MAPS(Parent, UndirGraph);
    585585  };
    586586
     
    895895    /// one for the backward edges.
    896896    class EdgeMap {
     897      template <typename TT> friend class EdgeMap;
    897898      typename Graph::template EdgeMap<T> forward_map, backward_map;
    898899    public:
    899900      typedef T ValueType;
    900901      typedef Edge KeyType;
     902
    901903      EdgeMap(const SubBidirGraphWrapper<Graph,
    902904              ForwardFilterMap, BackwardFilterMap>& g) :
    903905        forward_map(*(g.graph)), backward_map(*(g.graph)) { }
     906
    904907      EdgeMap(const SubBidirGraphWrapper<Graph,
    905908              ForwardFilterMap, BackwardFilterMap>& g, T a) :
    906909        forward_map(*(g.graph), a), backward_map(*(g.graph), a) { }
     910
     911      template <typename TT>
     912      EdgeMap(const EdgeMap<TT>& copy)
     913        : forward_map(copy.forward_map), backward_map(copy.backward_map) {}
     914
     915      template <typename TT>
     916      EdgeMap& operator=(const EdgeMap<TT>& copy) {
     917        forward_map = copy.forward_map;
     918        backward_map = copy.backward_map;
     919        return *this;
     920      }
     921     
    907922      void set(Edge e, T a) {
    908923        if (!e.backward)
     
    911926          backward_map.set(e, a);
    912927      }
    913       T operator[](Edge e) const {
     928
     929      typename Graph::template EdgeMap<T>::ConstReferenceType
     930      operator[](Edge e) const {
    914931        if (!e.backward)
    915932          return forward_map[e];
     
    917934          return backward_map[e];
    918935      }
     936
     937      typename Graph::template EdgeMap<T>::ReferenceType
     938      operator[](Edge e) {
     939        if (!e.backward)
     940          return forward_map[e];
     941        else
     942          return backward_map[e];
     943      }
     944
    919945      void update() {
    920946        forward_map.update();
     
    924950
    925951
    926     KEEP_NODE_MAP(Parent, SubBidirGraphWrapper);
     952    //    KEEP_NODE_MAP(Parent, SubBidirGraphWrapper);
    927953
    928954  };
     
    966992      return 2*this->graph->edgeNum();
    967993    }
    968     KEEP_MAPS(Parent, BidirGraphWrapper);
     994    //    KEEP_MAPS(Parent, BidirGraphWrapper);
    969995  };
    970996
     
    9921018      Parent::setGraph(gr);
    9931019    }
    994     KEEP_MAPS(Parent, BidirGraph);
     1020    //    KEEP_MAPS(Parent, BidirGraph);
    9951021  };
    9961022
     
    11071133    };
    11081134
    1109     KEEP_MAPS(Parent, ResGraphWrapper);
     1135    //    KEEP_MAPS(Parent, ResGraphWrapper);
    11101136  };
    11111137
     
    11691195    }
    11701196
    1171     KEEP_MAPS(Parent, ErasingFirstGraphWrapper);
     1197    //    KEEP_MAPS(Parent, ErasingFirstGraphWrapper);
    11721198  };
    11731199
  • src/hugo/list_graph.h

    r880 r891  
    443443    typedef SymListGraph Graph;
    444444
    445     /// Importing maps from the base class ListGraph.
    446     KEEP_MAPS(ListGraph, SymListGraph);
    447 
    448445    /// Creating symmetric map registry.
    449446    CREATE_SYM_EDGE_MAP_REGISTRY;
  • src/hugo/map_defines.h

    r877 r891  
    3939template <typename Value> \
    4040class NodeMap : public DynMap<NodeMapRegistry, Value> { \
    41 typedef DynMap<NodeMapRegistry, Value> MapImpl; \
    42 public: \
     41public: \
     42typedef DynMap<NodeMapRegistry, Value> Parent; \
    4343NodeMap() {} \
    44 NodeMap(const typename MapImpl::Graph& g) \
    45   : MapImpl(g, g.node_maps) {} \
    46 NodeMap(const typename MapImpl::Graph& g, const Value& v) \
    47   : MapImpl(g, g.node_maps, v) {} \
    48 NodeMap(const NodeMap& copy) : MapImpl(static_cast<const MapImpl&>(copy)) {} \
    49 template <typename CMap> NodeMap(const CMap& copy) : MapImpl(copy) {} \
     44NodeMap(const typename Parent::Graph& g) \
     45  : Parent(g, g.node_maps) {} \
     46NodeMap(const typename Parent::Graph& g, const Value& v) \
     47  : Parent(g, g.node_maps, v) {} \
     48NodeMap(const NodeMap& copy) : Parent(static_cast<const Parent&>(copy)) {} \
     49template <typename TT> \
     50NodeMap(const NodeMap<TT>& copy) \
     51  : Parent(static_cast<const typename NodeMap<TT>::Parent&>(copy)) {} \
    5052NodeMap& operator=(const NodeMap& copy) { \
    51   MapImpl::operator=(static_cast<const MapImpl&>(copy));\
    52   return *this; \
    53 } \
    54 template <typename CMap> NodeMap& operator=(const CMap& copy) { \
    55   MapImpl::operator=(copy);\
     53  Parent::operator=(static_cast<const Parent&>(copy));\
     54  return *this; \
     55} \
     56template <typename TT> \
     57NodeMap& operator=(const NodeMap<TT>& copy) { \
     58  Parent::operator=(static_cast<const typename NodeMap<TT>::Parent&>(copy));\
    5659  return *this; \
    5760} \
     
    6770template <typename Value> \
    6871class EdgeMap : public DynMap<EdgeMapRegistry, Value> { \
    69 typedef DynMap<EdgeMapRegistry, Value> MapImpl; \
    70 public: \
     72public: \
     73typedef DynMap<EdgeMapRegistry, Value> Parent; \
     74\
    7175EdgeMap() {} \
    72 EdgeMap(const typename MapImpl::Graph& g) \
    73   : MapImpl(g, g.edge_maps) {} \
    74 EdgeMap(const typename MapImpl::Graph& g, const Value& v) \
    75   : MapImpl(g, g.edge_maps, v) {} \
    76 EdgeMap(const EdgeMap& copy) : MapImpl(static_cast<const MapImpl&>(copy)) {} \
    77 template <typename CMap> EdgeMap(const CMap& copy) : MapImpl(copy) {} \
     76EdgeMap(const typename Parent::Graph& g) \
     77  : Parent(g, g.edge_maps) {} \
     78EdgeMap(const typename Parent::Graph& g, const Value& v) \
     79  : Parent(g, g.edge_maps, v) {} \
     80EdgeMap(const EdgeMap& copy) : Parent(static_cast<const Parent&>(copy)) {} \
     81template <typename TT> \
     82EdgeMap(const EdgeMap<TT>& copy) \
     83  : Parent(static_cast<const typename EdgeMap<TT>::Parent&>(copy)) {} \
    7884EdgeMap& operator=(const EdgeMap& copy) { \
    79   MapImpl::operator=(static_cast<const MapImpl&>(copy));\
    80   return *this; \
    81 } \
    82 template <typename CMap> EdgeMap& operator=(const CMap& copy) { \
    83   MapImpl::operator=(copy);\
     85  Parent::operator=(static_cast<const Parent&>(copy));\
     86  return *this; \
     87} \
     88template <typename TT> \
     89EdgeMap& operator=(const EdgeMap<TT>& copy) { \
     90  Parent::operator=(static_cast<const typename EdgeMap<TT>::Parent&>(copy));\
    8491  return *this; \
    8592} \
     
    109116template <typename Value> \
    110117class SymEdgeMap : public SymMap<DynMap, SymEdgeMapRegistry, Value> { \
    111   typedef SymMap<DynMap, SymEdgeMapRegistry, Value> MapImpl; \
    112  public: \
    113 \
    114   SymEdgeMap() {} \
    115 \
    116   SymEdgeMap(const typename MapImpl::Graph& g) \
    117     : MapImpl(g, g.sym_edge_maps) {} \
    118 \
    119   SymEdgeMap(const typename MapImpl::Graph& g, const Value& v) \
    120     : MapImpl(g, g.sym_edge_maps, v) {} \
    121 \
    122   SymEdgeMap(const SymEdgeMap& copy) \
    123     : MapImpl(static_cast<const MapImpl&>(copy)) {} \
    124 \
    125   template <typename CMap> SymEdgeMap(const CMap& copy) : MapImpl(copy) {} \
    126   SymEdgeMap& operator=(const SymEdgeMap& copy) { \
    127     MapImpl::operator=(static_cast<const MapImpl&>(copy));\
    128     return *this; \
    129   } \
    130 \
    131   template <typename CMap> SymEdgeMap& operator=(const CMap& copy) { \
    132     MapImpl::operator=(copy);\
    133     return *this; \
    134   } \
    135 };
    136 
     118public: \
     119typedef SymMap<DynMap, SymEdgeMapRegistry, Value> Parent; \
     120\
     121SymEdgeMap() {} \
     122SymEdgeMap(const typename Parent::Graph& g) \
     123  : Parent(g, g.sym_edge_maps) {} \
     124SymEdgeMap(const typename Parent::Graph& g, const Value& v) \
     125  : Parent(g, g.sym_edge_maps, v) {} \
     126SymEdgeMap(const SymEdgeMap& copy) \
     127  : Parent(static_cast<const Parent&>(copy)) {} \
     128template <typename TT> \
     129SymEdgeMap(const NodeMap<TT>& copy) \
     130  : Parent(static_cast<const typename SymEdgeMap<TT>::Parent&>(copy)) {} \
     131SymEdgeMap& operator=(const SymEdgeMap& copy) { \
     132  Parent::operator=(static_cast<const Parent&>(copy));\
     133  return *this; \
     134} \
     135template <typename TT> \
     136SymEdgeMap& operator=(const SymEdgeMap<TT>& copy) { \
     137  Parent::operator=(static_cast<const typename SymEdgeMap<TT>::Parent&>(copy));\
     138  return *this; \
     139} \
     140};
    137141
    138142/** This is a macro to import an node map into a graph class.
     
    140144#define IMPORT_NODE_MAP(From, from, To, to) \
    141145template <typename Value> \
    142 class NodeMap \
    143   : public From::template NodeMap<Value> { \
    144   typedef typename From::template NodeMap<Value> MapImpl; \
    145  public: \
    146    NodeMap() : MapImpl() {} \
    147 \
    148    NodeMap(const To& to) \
    149      : MapImpl(static_cast<const From&>(from)) { } \
    150 \
    151    NodeMap(const To& to, const Value& value) \
    152      : MapImpl(static_cast<const From&>(from), value) { } \
    153 \
    154    NodeMap(const NodeMap& copy) \
    155      : MapImpl(static_cast<const MapImpl&>(copy)) {} \
    156 \
    157    template<typename CMap> \
    158    NodeMap(const CMap& copy) \
    159      : MapImpl(copy) {} \
    160 \
    161    NodeMap& operator=(const NodeMap& copy) { \
    162      MapImpl::operator=(static_cast<const MapImpl&>(copy)); \
    163      return *this; \
    164    } \
    165 \
    166    template <typename CMap> \
    167    NodeMap& operator=(const CMap& copy) { \
    168      MapImpl::operator=(copy); \
    169      return *this; \
    170    } \
     146class NodeMap : public From::template NodeMap<Value> { \
     147\
     148public: \
     149typedef typename From::template NodeMap<Value> Parent; \
     150\
     151NodeMap() : Parent() {} \
     152NodeMap(const To& to) \
     153  : Parent(static_cast<const From&>(from)) { } \
     154NodeMap(const To& to, const Value& value) \
     155  : Parent(static_cast<const From&>(from), value) { } \
     156NodeMap(const NodeMap& copy) \
     157  : Parent(static_cast<const Parent&>(copy)) {} \
     158template <typename TT> \
     159NodeMap(const NodeMap<TT>& copy) \
     160  : Parent(static_cast<const typename NodeMap<TT>::Parent&>(copy)) {} \
     161NodeMap& operator=(const NodeMap& copy) { \
     162  Parent::operator=(static_cast<const Parent&>(copy)); \
     163  return *this; \
     164} \
     165template <typename TT> \
     166NodeMap& operator=(const NodeMap<TT>& copy) { \
     167  Parent::operator=(static_cast<const typename NodeMap<TT>::Parent&>(copy));\
     168  return *this; \
     169} \
    171170};
    172171
     
    175174#define IMPORT_EDGE_MAP(From, from, To, to) \
    176175template <typename Value> \
    177 class EdgeMap \
    178   : public From::template EdgeMap<Value> { \
    179   typedef typename From::template EdgeMap<Value> MapImpl; \
    180  public: \
    181    EdgeMap() : MapImpl() {} \
    182 \
    183    EdgeMap(const To& to) \
    184      : MapImpl(static_cast<const From&>(from)) { } \
    185 \
    186    EdgeMap(const To& to, const Value& value) \
    187      : MapImpl(static_cast<const From&>(from), value) { } \
    188 \
    189    EdgeMap(const EdgeMap& copy) \
    190      : MapImpl(static_cast<const MapImpl&>(copy)) {} \
    191 \
    192    template<typename CMap> \
    193    EdgeMap(const CMap& copy) \
    194      : MapImpl(copy) {} \
    195 \
    196    EdgeMap& operator=(const EdgeMap& copy) { \
    197      MapImpl::operator=(static_cast<const MapImpl&>(copy)); \
    198      return *this; \
    199    } \
    200 \
    201    template <typename CMap> \
    202    EdgeMap& operator=(const CMap& copy) { \
    203      MapImpl::operator=(copy); \
    204      return *this; \
    205    } \
     176class EdgeMap : public From::template EdgeMap<Value> { \
     177\
     178public: \
     179typedef typename From::template EdgeMap<Value> Parent; \
     180\
     181EdgeMap() : Parent() {} \
     182EdgeMap(const To& to) \
     183  : Parent(static_cast<const From&>(from)) { } \
     184EdgeMap(const To& to, const Value& value) \
     185  : Parent(static_cast<const From&>(from), value) { } \
     186EdgeMap(const EdgeMap& copy) \
     187  : Parent(static_cast<const Parent&>(copy)) {} \
     188template <typename TT> \
     189EdgeMap(const EdgeMap<TT>& copy) \
     190  : Parent(static_cast<const typename EdgeMap<TT>::Parent&>(copy)) {} \
     191EdgeMap& operator=(const EdgeMap& copy) { \
     192  Parent::operator=(static_cast<const Parent&>(copy)); \
     193  return *this; \
     194} \
     195template <typename TT> \
     196EdgeMap& operator=(const EdgeMap<TT>& copy) { \
     197  Parent::operator=(static_cast<const typename EdgeMap<TT>::Parent&>(copy));\
     198  return *this; \
     199} \
    206200};
    207201
  • src/hugo/map_registry.h

    r822 r891  
    7171       * Assign operator.
    7272      */       
    73 
    7473      const MapBase& operator=(const MapBase& copy) {
    7574        if (registry) {
  • src/hugo/smart_graph.h

    r880 r891  
    318318    typedef SymSmartGraph Graph;
    319319
    320     /// Importing maps from the base class ListGraph.
    321     KEEP_MAPS(SmartGraph, SymSmartGraph);
    322 
    323320    /// Creating symmetric map registry.
    324321    CREATE_SYM_EDGE_MAP_REGISTRY;
  • src/hugo/sym_map.h

    r844 r891  
    104104      : MapImpl(static_cast<const MapImpl&>(copy)) {}
    105105
    106     /** Constructor to copy a map of an other map type.
    107      */
    108     template <typename CMap> SymMap(const CMap& copy)
    109       : MapImpl(copy) {}
    110 
    111106    /** Assign operator to copy a map of the same map type.
    112107     */
     
    116111    }
    117112
    118     /** Assign operator to copy a map of an other map type.
    119      */
    120     template <typename CMap> SymMap& operator=(const CMap& copy) {
    121       MapImpl::operator=(copy);
    122       return *this;
    123     }
    124    
    125113    /** Add a new key to the map. It called by the map registry.
    126114     */
  • src/hugo/vector_map.h

    r844 r891  
    3333  template <typename MapRegistry, typename Value>
    3434  class VectorMap : public MapRegistry::MapBase {
     35    template <typename MR, typename T> friend class VectorMap;
    3536  public:
    3637               
     
    8384      : MapBase(g, r), container(KeyInfo<Graph, KeyIt>::maxId(g)+1, v) {}
    8485
    85     /** Constructor to copy a map of an other map type.
    86      */
    87     template <typename CMap> VectorMap(const CMap& copy) : MapBase(copy) {
    88       if (MapBase::getGraph()) {
    89         container.resize(KeyInfo<Graph, KeyIt>::maxId(*MapBase::getGraph())+1);
    90         for (KeyIt it(*MapBase::getGraph()); it != INVALID; ++it) {
    91           set(it, copy[it]);
    92         }
     86    /** Assign operator to copy a map of an other map type.
     87     */
     88    template <typename TT>
     89    VectorMap(const VectorMap<MapRegistry, TT>& c)
     90      : MapBase(c), container(c.container.size()) {
     91      for (KeyIt it(*MapBase::getGraph()); it != INVALID; ++it) {
     92        int id = KeyInfo<Graph, KeyIt>::id(*MapBase::getGraph(), it);
     93        container[id] = c.container[id];
    9394      }
    9495    }
    9596
    96     /** Assign operator to copy a map an other map type.
    97      */
    98     template <typename CMap> VectorMap& operator=(const CMap& copy) {
    99       container.clear();
    100       this->MapBase::operator=(copy);
    101       if (MapBase::getGraph()) {
    102         container.resize(KeyInfo<Graph, KeyIt>::maxId(*MapBase::getGraph())+1);
    103         for (KeyIt it(*MapBase::getGraph()); it != INVALID; ++it) {
    104           set(it, copy[it]);
    105         }
     97    /** Assign operator to copy a map of an other map type.
     98     */
     99    template <typename TT>
     100    VectorMap& operator=(const VectorMap<MapRegistry, TT>& c) {
     101      container.resize(c.container.size());
     102      MapBase::operator=(c);
     103      for (KeyIt it(*MapBase::getGraph()); it != INVALID; ++it) {
     104        int id = KeyInfo<Graph, KeyIt>::id(*MapBase::getGraph(), it);
     105        container[id] = c.container[id];
    106106      }
    107107      return *this;
    108108    }
    109 
    110     /** The destructor of the map.
    111      */
    112     virtual ~VectorMap() {
    113     }
    114                
    115109    /**
    116110     * The subscript operator. The map can be subscripted by the
Note: See TracChangeset for help on using the changeset viewer.