COIN-OR::LEMON - Graph Library

Changeset 1022:567f392d1d2e in lemon-0.x for src/lemon/default_map.h


Ignore:
Timestamp:
11/28/04 17:30:10 (15 years ago)
Author:
Mihaly Barasz
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1412
Message:

UndirGraph? implementation nearly complete

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/lemon/default_map.h

    r987 r1022  
    173173    class NodeMap : public DefaultMap<Graph, Node, NodeIt, _Value> {
    174174    public:
    175       typedef DefaultMappableGraphExtender<_Base> Graph;
    176 
    177       typedef typename Graph::Node Node;
    178       typedef typename Graph::NodeIt NodeIt;
    179 
     175      typedef DefaultMappableGraphExtender Graph;
    180176      typedef DefaultMap<Graph, Node, NodeIt, _Value> Parent;
    181 
    182       //typedef typename Parent::Graph Graph;
    183       typedef typename Parent::Value Value;
    184177
    185178      NodeMap(const Graph& _g)
    186179        : Parent(_g) {}
    187       NodeMap(const Graph& _g, const Value& _v)
     180      NodeMap(const Graph& _g, const _Value& _v)
    188181        : Parent(_g, _v) {}
    189 
    190182    };
    191183
     
    193185    class EdgeMap : public DefaultMap<Graph, Edge, EdgeIt, _Value> {
    194186    public:
    195       typedef DefaultMappableGraphExtender<_Base> Graph;
    196 
    197       typedef typename Graph::Edge Edge;
    198       typedef typename Graph::EdgeIt EdgeIt;
    199 
     187      typedef DefaultMappableGraphExtender Graph;
    200188      typedef DefaultMap<Graph, Edge, EdgeIt, _Value> Parent;
    201 
    202       //typedef typename Parent::Graph Graph;
    203       typedef typename Parent::Value Value;
    204189
    205190      EdgeMap(const Graph& _g)
    206191        : Parent(_g) {}
    207       EdgeMap(const Graph& _g, const Value& _v)
     192      EdgeMap(const Graph& _g, const _Value& _v)
    208193        : Parent(_g, _v) {}
    209 
    210194    };
    211195   
    212196  };
    213197
     198  template <typename _Base>
     199  class MappableUndirGraphExtender :
     200    public DefaultMappableGraphExtender<_Base> {
     201  public:
     202
     203    typedef MappableUndirGraphExtender Graph;
     204    typedef DefaultMappableGraphExtender<_Base> Parent;
     205
     206    typedef typename Parent::UndirEdge UndirEdge;
     207    typedef typename Parent::UndirEdgeIt UndirEdgeIt;
     208
     209    template <typename _Value>
     210    class UndirEdgeMap :
     211      public DefaultMap<Graph, UndirEdge, UndirEdgeIt, _Value> {
     212    public:
     213      typedef MappableUndirGraphExtender Graph;
     214      typedef DefaultMap<Graph, UndirEdge, UndirEdgeIt, _Value> Parent;
     215
     216      UndirEdgeMap(const Graph& _g)
     217        : Parent(_g) {}
     218      UndirEdgeMap(const Graph& _g, const _Value& _v)
     219        : Parent(_g, _v) {}
     220    };
     221
     222
     223  };
    214224
    215225}
Note: See TracChangeset for help on using the changeset viewer.