COIN-OR::LEMON - Graph Library

Changeset 1909:2d806130e700 in lemon-0.x for lemon/bits/static_map.h


Ignore:
Timestamp:
01/26/06 16:42:13 (18 years ago)
Author:
Mihaly Barasz
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2484
Message:

Undir -> U transition

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/bits/static_map.h

    r1875 r1909  
    306306  /// \e
    307307  template <typename _Base>
    308   class StaticMappableUndirGraphExtender :
     308  class StaticMappableUGraphExtender :
    309309    public StaticMappableGraphExtender<_Base> {
    310310  public:
    311311
    312     typedef StaticMappableUndirGraphExtender Graph;
     312    typedef StaticMappableUGraphExtender Graph;
    313313    typedef StaticMappableGraphExtender<_Base> Parent;
    314314
    315     typedef typename Parent::UndirEdge UndirEdge;
    316 
    317     template <typename _Value>
    318     class UndirEdgeMap
    319       : public IterableMapExtender<StaticMap<Graph, UndirEdge, _Value> > {
    320     public:
    321       typedef StaticMappableUndirGraphExtender Graph;
     315    typedef typename Parent::UEdge UEdge;
     316
     317    template <typename _Value>
     318    class UEdgeMap
     319      : public IterableMapExtender<StaticMap<Graph, UEdge, _Value> > {
     320    public:
     321      typedef StaticMappableUGraphExtender Graph;
    322322      typedef IterableMapExtender<
    323         StaticMap<Graph, UndirEdge, _Value> > Parent;
    324 
    325       UndirEdgeMap(const Graph& _g)
    326         : Parent(_g) {}
    327       UndirEdgeMap(const Graph& _g, const _Value& _v)
    328         : Parent(_g, _v) {}
    329 
    330       UndirEdgeMap& operator=(const UndirEdgeMap& cmap) {
    331         return operator=<UndirEdgeMap>(cmap);
    332       }
    333 
    334       template <typename CMap>
    335       UndirEdgeMap& operator=(const CMap& cmap) {
    336         checkConcept<concept::ReadMap<UndirEdge, _Value>, CMap>();
    337         const typename Parent::Graph* graph = Parent::getGraph();
    338         UndirEdge it;
     323        StaticMap<Graph, UEdge, _Value> > Parent;
     324
     325      UEdgeMap(const Graph& _g)
     326        : Parent(_g) {}
     327      UEdgeMap(const Graph& _g, const _Value& _v)
     328        : Parent(_g, _v) {}
     329
     330      UEdgeMap& operator=(const UEdgeMap& cmap) {
     331        return operator=<UEdgeMap>(cmap);
     332      }
     333
     334      template <typename CMap>
     335      UEdgeMap& operator=(const CMap& cmap) {
     336        checkConcept<concept::ReadMap<UEdge, _Value>, CMap>();
     337        const typename Parent::Graph* graph = Parent::getGraph();
     338        UEdge it;
    339339        for (graph->first(it); it != INVALID; graph->next(it)) {
    340340          Parent::set(it, cmap[it]);
     
    347347
    348348  template <typename _Base>
    349   class StaticMappableUndirBipartiteGraphExtender : public _Base {
     349  class StaticMappableUBipartiteGraphExtender : public _Base {
    350350  public:
    351351
    352352    typedef _Base Parent;
    353     typedef StaticMappableUndirBipartiteGraphExtender Graph;
     353    typedef StaticMappableUBipartiteGraphExtender Graph;
    354354
    355355    typedef typename Parent::Node Node;
     
    357357    typedef typename Parent::LowerNode LowerNode;
    358358    typedef typename Parent::Edge Edge;
    359     typedef typename Parent::UndirEdge UndirEdge;
     359    typedef typename Parent::UEdge UEdge;
    360360   
    361361    template <typename _Value>
     
    363363      : public IterableMapExtender<StaticMap<Graph, UpperNode, _Value> > {
    364364    public:
    365       typedef StaticMappableUndirBipartiteGraphExtender Graph;
     365      typedef StaticMappableUBipartiteGraphExtender Graph;
    366366      typedef IterableMapExtender<StaticMap<Graph, UpperNode, _Value> >
    367367      Parent;
     
    400400      : public IterableMapExtender<StaticMap<Graph, LowerNode, _Value> > {
    401401    public:
    402       typedef StaticMappableUndirBipartiteGraphExtender Graph;
     402      typedef StaticMappableUBipartiteGraphExtender Graph;
    403403      typedef IterableMapExtender<StaticMap<Graph, LowerNode, _Value> >
    404404      Parent;
     
    438438    class NodeMapBase : public Parent::NodeNotifier::ObserverBase {
    439439    public:
    440       typedef StaticMappableUndirBipartiteGraphExtender Graph;
     440      typedef StaticMappableUBipartiteGraphExtender Graph;
    441441
    442442      typedef Node Key;
     
    518518      : public IterableMapExtender<NodeMapBase<_Value> > {
    519519    public:
    520       typedef StaticMappableUndirBipartiteGraphExtender Graph;
     520      typedef StaticMappableUBipartiteGraphExtender Graph;
    521521      typedef IterableMapExtender< NodeMapBase<_Value> > Parent;
    522522   
     
    556556      : public IterableMapExtender<StaticMap<Graph, Edge, _Value> > {
    557557    public:
    558       typedef StaticMappableUndirBipartiteGraphExtender Graph;
     558      typedef StaticMappableUBipartiteGraphExtender Graph;
    559559      typedef IterableMapExtender<StaticMap<Graph, Edge, _Value> > Parent;
    560560   
     
    581581
    582582    template <typename _Value>
    583     class UndirEdgeMap
    584       : public IterableMapExtender<StaticMap<Graph, UndirEdge, _Value> > {
    585     public:
    586       typedef StaticMappableUndirBipartiteGraphExtender Graph;
    587       typedef IterableMapExtender<StaticMap<Graph, UndirEdge, _Value> >
     583    class UEdgeMap
     584      : public IterableMapExtender<StaticMap<Graph, UEdge, _Value> > {
     585    public:
     586      typedef StaticMappableUBipartiteGraphExtender Graph;
     587      typedef IterableMapExtender<StaticMap<Graph, UEdge, _Value> >
    588588      Parent;
    589589   
    590       UndirEdgeMap(const Graph& _g)
    591         : Parent(_g) {}
    592       UndirEdgeMap(const Graph& _g, const _Value& _v)
    593         : Parent(_g, _v) {}
    594    
    595       UndirEdgeMap& operator=(const UndirEdgeMap& cmap) {
    596         return operator=<UndirEdgeMap>(cmap);
    597       }
    598    
    599       template <typename CMap>
    600       UndirEdgeMap& operator=(const CMap& cmap) {
    601         checkConcept<concept::ReadMap<UndirEdge, _Value>, CMap>();
    602         const typename Parent::Graph* graph = Parent::getGraph();
    603         UndirEdge it;
     590      UEdgeMap(const Graph& _g)
     591        : Parent(_g) {}
     592      UEdgeMap(const Graph& _g, const _Value& _v)
     593        : Parent(_g, _v) {}
     594   
     595      UEdgeMap& operator=(const UEdgeMap& cmap) {
     596        return operator=<UEdgeMap>(cmap);
     597      }
     598   
     599      template <typename CMap>
     600      UEdgeMap& operator=(const CMap& cmap) {
     601        checkConcept<concept::ReadMap<UEdge, _Value>, CMap>();
     602        const typename Parent::Graph* graph = Parent::getGraph();
     603        UEdge it;
    604604        for (graph->first(it); it != INVALID; graph->next(it)) {
    605605          Parent::set(it, cmap[it]);
Note: See TracChangeset for help on using the changeset viewer.