COIN-OR::LEMON - Graph Library

Changeset 798:6d1abeb62dd3 in lemon-0.x for src/hugo


Ignore:
Timestamp:
09/03/04 17:11:17 (20 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1092
Message:
 
Location:
src/hugo
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • src/hugo/full_graph.h

    r782 r798  
    1414
    1515#include <hugo/map_registry.h>
    16 #include <hugo/array_map_factory.h>
     16#include <hugo/default_map_factory.h>
    1717
    1818namespace hugo {
     
    4949   
    5050    CREATE_MAP_REGISTRIES;
    51     CREATE_MAPS(ArrayMapFactory);
     51    CREATE_MAPS(DefaultMapFactory);
    5252   
    5353  public:
  • src/hugo/list_graph.h

    r782 r798  
    1414
    1515#include <hugo/map_registry.h>
    16 #include <hugo/array_map_factory.h>
     16#include <hugo/default_map_factory.h>
    1717
    1818#include <hugo/sym_map_factory.h>
     
    8181
    8282    CREATE_MAP_REGISTRIES;
    83     CREATE_MAPS(ArrayMapFactory);
     83    CREATE_MAPS(DefaultMapFactory);
    8484
    8585  public:
     
    426426
    427427    CREATE_SYM_EDGE_MAP_REGISTRY;
    428     CREATE_SYM_EDGE_MAP_FACTORY(ArrayMapFactory);
     428    CREATE_SYM_EDGE_MAP_FACTORY(DefaultMapFactory);
    429429    IMPORT_SYM_EDGE_MAP(SymEdgeMapFactory);
    430430
     
    509509   
    510510    CREATE_MAP_REGISTRIES;
    511     CREATE_MAPS(ArrayMapFactory);
     511    CREATE_MAPS(DefaultMapFactory);
    512512   
    513513  public:
     
    806806
    807807    CREATE_EDGE_MAP_REGISTRY;
    808     CREATE_EDGE_MAP_FACTORY(ArrayMapFactory);
     808    CREATE_EDGE_MAP_FACTORY(DefaultMapFactory);
    809809    IMPORT_EDGE_MAP(EdgeMapFactory);
    810810   
  • src/hugo/smart_graph.h

    r782 r798  
    1313#include <hugo/invalid.h>
    1414
    15 #include <hugo/array_map_factory.h>
     15#include <hugo/default_map_factory.h>
    1616#include <hugo/sym_map_factory.h>
    1717#include <hugo/map_registry.h>
     
    7474   
    7575    CREATE_MAP_REGISTRIES;
    76     CREATE_MAPS(ArrayMapFactory);
     76    CREATE_MAPS(DefaultMapFactory);
    7777   
    7878  public:
     
    297297
    298298    CREATE_SYM_EDGE_MAP_REGISTRY;
    299     CREATE_SYM_EDGE_MAP_FACTORY(ArrayMapFactory);
     299    CREATE_SYM_EDGE_MAP_FACTORY(DefaultMapFactory);
    300300    IMPORT_SYM_EDGE_MAP(SymEdgeMapFactory);
    301301
     
    306306    {
    307307      Edge e = SmartGraph::addEdge(u,v);
    308       SmartGraph::addEdge(v,u);
     308      Edge f = SmartGraph::addEdge(v,u);
     309      sym_edge_maps.add(e);
     310      sym_edge_maps.add(f);
    309311      return e;
    310312    }
  • src/hugo/sym_map_factory.h

    r786 r798  
    1313
    1414    SymEdgeIt(const Graph& graph)
    15       : EdgeIt(graph) {}
     15      : EdgeIt(graph) {
     16      while ( n != -1 && (n & 1)) {
     17        EdgeIt::operator++();
     18      }
     19    }
    1620
    1721    SymEdgeIt(Invalid invalid)
     
    5357      Map(const Graph& g, MapRegistry& r) : MapImpl(g, r) {}
    5458
    55       Map(const Graph& g, MapRegistry& r, const Value& v) : MapImpl(g, r, v) {}
     59      Map(const Graph& g, MapRegistry& r, const Value& v)
     60        : MapImpl(g, r, v) {}
    5661
    5762      Map(const Map& copy) : MapImpl(static_cast<const MapImpl&>(copy)) {}
  • src/hugo/vector_map_factory.h

    r786 r798  
    1818  /** The VectorMapFactory template class is a factory class
    1919   *  to create maps for the edge and nodes. This map factory
    20    *  use the std::vector to implement the container function.
     20   *  uses the std::vector to implement the container function.
    2121   *
    2222   *  The template parameter is the MapRegistry that the maps
     
    4343    template <typename V>
    4444    class Map : public MapBase {
     45
     46      typedef std::vector<V> Container;
     47
    4548    public:
     49
     50      /// The value type of the map.
     51      typedef V ValueType;
    4652
    4753      /// The value type of the map.
    4854      typedef V Value;
    49 
    50       typedef std::vector<Value> Container;     
     55      /// The reference type of the map;
     56      typedef typename Container::reference Reference;
     57      /// The pointer type of the map;
     58      typedef typename Container::pointer Pointer;
     59
     60      /// The const value type of the map.
     61      typedef const Value ConstValue;
     62      /// The const reference type of the map;
     63      typedef typename Container::const_reference ConstReference;
     64      /// The pointer type of the map;
     65      typedef typename Container::const_pointer ConstPointer;
    5166
    5267      /** Default constructor for the map.
     
    6580        for (KeyIt it(*getGraph()); it != INVALID; ++it) {
    6681          int id = getGraph()->id(it);
    67           if (id >= container.size()) {
     82          if (id >= (int)container.size()) {
    6883            container.resize(id + 1);
    6984          }
     
    7893          for (KeyIt it(*getGraph()); it != INVALID; ++it) {
    7994            int id = getGraph()->id(it);
    80             if (id >= container.size()) {
     95            if (id >= (int)container.size()) {
    8196              container.resize(id + 1);
    8297            }
     
    96111          for (KeyIt it(*getGraph()); it != INVALID; ++it) {
    97112            int id = getGraph()->id(it);
    98             if (id >= container.size()) {
     113            if (id >= (int)container.size()) {
    99114              container.resize(id + 1);
    100115            }
     
    102117          }
    103118        }
     119        return *this;
    104120      }
    105121
     
    113129       * actual keys of the graph.
    114130       */
     131<<<<<<< .mine
     132      Reference operator[](const Key& key) {
     133=======
    115134      typename Container::reference operator[](const KeyType& key) {
     135>>>>>>> .r1091
    116136        int id = getGraph()->id(key);
    117137        return container[id];
     
    122142       * actual keys of the graph.
    123143       */
     144<<<<<<< .mine
     145      ConstReference operator[](const Key& key) const {
     146=======
    124147      typename Container::const_reference operator[](const KeyType& key) const {
     148>>>>>>> .r1091
    125149        int id = getGraph()->id(key);
    126150        return container[id];
     
    139163      void add(const KeyType& key) {
    140164        int id = getGraph()->id(key);
    141         if (id >= container.size()) {
     165        if (id >= (int)container.size()) {
    142166          container.resize(id + 1);
    143167        }
     
    174198
    175199        typedef extended_pair<const KeyType&, const KeyType&,
    176                               Value&, Value&> Reference;
     200                              Map::Reference, Map::Reference> Reference;
    177201
    178202        /** Dereference operator for map.
     
    264288     
    265289        typedef extended_pair<const KeyType&, const KeyType&,
    266           const Value&, const Value&> Reference;
     290          Map::ConstReference, Map::ConstReference> Reference;
    267291
    268292        /** Dereference operator for map.
Note: See TracChangeset for help on using the changeset viewer.