COIN-OR::LEMON - Graph Library

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

    r1993 r2031  
    2121
    2222#include <lemon/bits/default_map.h>
     23#include <lemon/bits/map_extender.h>
    2324
    2425#include <vector>
     
    401402  template <typename _Graph, typename _Item>
    402403  class IterableIntMap
    403     : protected DefaultMap<_Graph, _Item, _iterable_maps_bits::
    404                            IterableIntMapNode<_Item> > {
     404    : protected MapExtender<DefaultMap<_Graph, _Item, _iterable_maps_bits::
     405                                       IterableIntMapNode<_Item> > >{
    405406  public:
    406     typedef DefaultMap<_Graph, _Item, _iterable_maps_bits::
    407                        IterableIntMapNode<_Item> >
    408     Parent;
     407    typedef MapExtender<DefaultMap<_Graph, _Item, _iterable_maps_bits::
     408                                   IterableIntMapNode<_Item> > > Parent;
    409409
    410410    /// The key type
     
    690690  template <typename _Graph, typename _Item, typename _Value>
    691691  class IterableValueMap
    692     : protected DefaultMap<_Graph, _Item, _iterable_maps_bits::
    693                            IterableValueMapNode<_Item, _Value> > {
     692    : protected MapExtender<DefaultMap<_Graph, _Item, _iterable_maps_bits::
     693                                       IterableValueMapNode<_Item, _Value> > >{
    694694  public:
    695     typedef DefaultMap<_Graph, _Item, _iterable_maps_bits::
    696                        IterableValueMapNode<_Item, _Value> > Parent;
     695    typedef MapExtender<DefaultMap<_Graph, _Item, _iterable_maps_bits::
     696                                   IterableValueMapNode<_Item, _Value> > >
     697    Parent;
    697698
    698699    /// The key type
     
    703704    typedef _Graph Graph;
    704705
    705   protected:
    706 
    707     typedef typename ItemSetTraits<_Graph, Key>::ItemIt KeyIt;
    708 
    709706  public:
    710707
     
    716713      : Parent(graph, _iterable_maps_bits::
    717714               IterableValueMapNode<_Item, _Value>(value)) {
    718       for (KeyIt it(*Parent::getGraph()); it != INVALID; ++it) {
     715      for (typename Parent::ItemIt it(*this); it != INVALID; ++it) {
    719716        lace(it);
    720717      }
     
    904901    virtual void build() {
    905902      Parent::build();
    906       for (KeyIt it(*Parent::getGraph()); it != INVALID; ++it) {
     903      for (typename Parent::ItemIt it(*this); it != INVALID; ++it) {
    907904        lace(it);
    908905      }
Note: See TracChangeset for help on using the changeset viewer.