src/work/sage_graph.h
changeset 1308 0274efa2222f
parent 986 e997802b855c
equal deleted inserted replaced
3:80c0f26741b4 4:3ea583ba535d
    36     template <typename T>
    36     template <typename T>
    37     class NodeMap {
    37     class NodeMap {
    38       const SageGraph& G; 
    38       const SageGraph& G; 
    39       std::vector<T> container;
    39       std::vector<T> container;
    40     public:
    40     public:
    41       typedef T ValueType;
    41       typedef T Value;
    42       typedef Node KeyType;
    42       typedef Node Key;
    43       NodeMap(const SageGraph& _G) : G(_G), container(G.node_id) { }
    43       NodeMap(const SageGraph& _G) : G(_G), container(G.node_id) { }
    44       NodeMap(const SageGraph& _G, T a) : 
    44       NodeMap(const SageGraph& _G, T a) : 
    45 	G(_G), container(G.node_id, a) { }
    45 	G(_G), container(G.node_id, a) { }
    46       void set(Node n, T a) { container[/*G.id(n)*/n.node->id]=a; }
    46       void set(Node n, T a) { container[/*G.id(n)*/n.node->id]=a; }
    47 //      T get(Node n) const { return container[/*G.id(n)*/n.node->id]; }
    47 //      T get(Node n) const { return container[/*G.id(n)*/n.node->id]; }
    57     template <typename T>
    57     template <typename T>
    58     class EdgeMap {
    58     class EdgeMap {
    59       const SageGraph& G; 
    59       const SageGraph& G; 
    60       std::vector<T> container;
    60       std::vector<T> container;
    61     public:
    61     public:
    62       typedef T ValueType;
    62       typedef T Value;
    63       typedef Edge KeyType;
    63       typedef Edge Key;
    64       EdgeMap(const SageGraph& _G) : G(_G), container(G.edge_id) { }
    64       EdgeMap(const SageGraph& _G) : G(_G), container(G.edge_id) { }
    65       EdgeMap(const SageGraph& _G, T a) : 
    65       EdgeMap(const SageGraph& _G, T a) : 
    66 	G(_G), container(G.edge_id, a) { }
    66 	G(_G), container(G.edge_id, a) { }
    67       void set(Edge e, T a) { container[/*G.id(e)*/e.edge->id]=a; }
    67       void set(Edge e, T a) { container[/*G.id(e)*/e.edge->id]=a; }
    68 //      T get(Edge e) const { return container[/*G.id(e)*/e.edge->id]; }
    68 //      T get(Edge e) const { return container[/*G.id(e)*/e.edge->id]; }