COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
05/10/04 15:49:35 (20 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@775
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/deba/vector_map_factory.h

    r571 r595  
    33
    44#include <vector>
    5 #include <iostream>
    65
    76#include "map_base.h"
     
    2019               
    2120                template <typename V>
    22                 class VectorMap : public MapBase<G, K, KIt> {
     21                class Map : public MapBase<G, K, KIt> {
    2322                public:
    24                         typedef V ValueType;
     23                        typedef V Value;
    2524       
    26                         VectorMap() {}
     25                        Map() {}
    2726                       
    28                         VectorMap(Graph& g, MapRegistry<G, K, KIt>& r)
    29                                 : MapBase<G, K, KIt>(g, r) {}
     27                        Map(Graph& g, MapRegistry<G, K, KIt>& r)
     28                                : MapBase<G, K, KIt>(g, r) {
     29                                init();
     30                        }
     31                               
     32                        virtual ~Map() {
     33                                destroy();
     34                        }
    3035       
    3136       
    32                         ValueType& operator[](const K& key) {
     37                        Value& operator[](const K& key) {
    3338                                int id = graph->id(key);
    3439                                return container[id];
    3540                        }
    3641               
    37                         const ValueType& operator[](const K& key) const {
     42                        const Value& operator[](const K& key) const {
    3843                                int id = graph->id(key);
    3944                                return container[id];
    4045                        }
    4146       
    42                         const ValueType& get(const K& key) const {
     47                        const Value& get(const K& key) const {
    4348                                int id = graph->id(key);
    4449                                return container[id];
    4550                        }
    4651               
    47                         void set(const K& key, const ValueType& val) {
     52                        void set(const K& key, const Value& val) {
    4853                                int id = graph->id(key);
    4954                                container[id] = val;
     
    5257                        void add(const K& key) {
    5358                                int id = graph->id(key);
    54                                 std::cerr << id << std::endl;
    5559                                if (id >= container.size()) {
    5660                                        container.resize(id + 1);
     
    6165       
    6266                private:
    63                         typedef std::vector<ValueType> Container;
     67                        typedef std::vector<Value> Container;
    6468               
    6569                        Container container;
Note: See TracChangeset for help on using the changeset viewer.