COIN-OR::LEMON - Graph Library

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


Ignore:
Timestamp:
01/26/06 16:42:13 (14 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/default_map.h

    r1875 r1909  
    267267  /// \e
    268268  template <typename _Base>
    269   class MappableUndirGraphExtender :
     269  class MappableUGraphExtender :
    270270    public MappableGraphExtender<_Base> {
    271271  public:
    272272
    273     typedef MappableUndirGraphExtender Graph;
     273    typedef MappableUGraphExtender Graph;
    274274    typedef MappableGraphExtender<_Base> Parent;
    275275
    276     typedef typename Parent::UndirEdge UndirEdge;
    277 
    278     template <typename _Value>
    279     class UndirEdgeMap
    280       : public IterableMapExtender<DefaultMap<Graph, UndirEdge, _Value> > {
    281     public:
    282       typedef MappableUndirGraphExtender Graph;
     276    typedef typename Parent::UEdge UEdge;
     277
     278    template <typename _Value>
     279    class UEdgeMap
     280      : public IterableMapExtender<DefaultMap<Graph, UEdge, _Value> > {
     281    public:
     282      typedef MappableUGraphExtender Graph;
    283283      typedef IterableMapExtender<
    284         DefaultMap<Graph, UndirEdge, _Value> > Parent;
    285 
    286       UndirEdgeMap(const Graph& _g)
    287         : Parent(_g) {}
    288       UndirEdgeMap(const Graph& _g, const _Value& _v)
    289         : Parent(_g, _v) {}
    290 
    291       UndirEdgeMap& operator=(const UndirEdgeMap& cmap) {
    292         return operator=<UndirEdgeMap>(cmap);
    293       }
    294 
    295       template <typename CMap>
    296       UndirEdgeMap& operator=(const CMap& cmap) {
    297         checkConcept<concept::ReadMap<UndirEdge, _Value>, CMap>();
    298         const typename Parent::Graph* graph = Parent::getGraph();
    299         UndirEdge it;
     284        DefaultMap<Graph, UEdge, _Value> > Parent;
     285
     286      UEdgeMap(const Graph& _g)
     287        : Parent(_g) {}
     288      UEdgeMap(const Graph& _g, const _Value& _v)
     289        : Parent(_g, _v) {}
     290
     291      UEdgeMap& operator=(const UEdgeMap& cmap) {
     292        return operator=<UEdgeMap>(cmap);
     293      }
     294
     295      template <typename CMap>
     296      UEdgeMap& operator=(const CMap& cmap) {
     297        checkConcept<concept::ReadMap<UEdge, _Value>, CMap>();
     298        const typename Parent::Graph* graph = Parent::getGraph();
     299        UEdge it;
    300300        for (graph->first(it); it != INVALID; graph->next(it)) {
    301301          Parent::set(it, cmap[it]);
     
    310310  /// \e
    311311  template <typename _Base>
    312   class MappableUndirEdgeSetExtender :
     312  class MappableUEdgeSetExtender :
    313313    public MappableEdgeSetExtender<_Base> {
    314314  public:
    315315
    316     typedef MappableUndirEdgeSetExtender Graph;
     316    typedef MappableUEdgeSetExtender Graph;
    317317    typedef MappableEdgeSetExtender<_Base> Parent;
    318318
    319     typedef typename Parent::UndirEdge UndirEdge;
    320 
    321     template <typename _Value>
    322     class UndirEdgeMap
    323       : public IterableMapExtender<DefaultMap<Graph, UndirEdge, _Value> > {
    324     public:
    325       typedef MappableUndirEdgeSetExtender Graph;
     319    typedef typename Parent::UEdge UEdge;
     320
     321    template <typename _Value>
     322    class UEdgeMap
     323      : public IterableMapExtender<DefaultMap<Graph, UEdge, _Value> > {
     324    public:
     325      typedef MappableUEdgeSetExtender Graph;
    326326      typedef IterableMapExtender<
    327         DefaultMap<Graph, UndirEdge, _Value> > Parent;
    328 
    329       UndirEdgeMap(const Graph& _g)
    330         : Parent(_g) {}
    331       UndirEdgeMap(const Graph& _g, const _Value& _v)
    332         : Parent(_g, _v) {}
    333 
    334       UndirEdgeMap& operator=(const UndirEdgeMap& cmap) {
    335         return operator=<UndirEdgeMap>(cmap);
    336       }
    337 
    338       template <typename CMap>
    339       UndirEdgeMap& operator=(const CMap& cmap) {
    340         checkConcept<concept::ReadMap<UndirEdge, _Value>, CMap>();
    341         const typename Parent::Graph* graph = Parent::getGraph();
    342         UndirEdge it;
     327        DefaultMap<Graph, UEdge, _Value> > Parent;
     328
     329      UEdgeMap(const Graph& _g)
     330        : Parent(_g) {}
     331      UEdgeMap(const Graph& _g, const _Value& _v)
     332        : Parent(_g, _v) {}
     333
     334      UEdgeMap& operator=(const UEdgeMap& cmap) {
     335        return operator=<UEdgeMap>(cmap);
     336      }
     337
     338      template <typename CMap>
     339      UEdgeMap& operator=(const CMap& cmap) {
     340        checkConcept<concept::ReadMap<UEdge, _Value>, CMap>();
     341        const typename Parent::Graph* graph = Parent::getGraph();
     342        UEdge it;
    343343        for (graph->first(it); it != INVALID; graph->next(it)) {
    344344          Parent::set(it, cmap[it]);
     
    353353
    354354  template <typename _Base>
    355   class MappableUndirBipartiteGraphExtender : public _Base {
     355  class MappableUBipartiteGraphExtender : public _Base {
    356356  public:
    357357
    358358    typedef _Base Parent;
    359     typedef MappableUndirBipartiteGraphExtender Graph;
     359    typedef MappableUBipartiteGraphExtender Graph;
    360360
    361361    typedef typename Parent::Node Node;
     
    363363    typedef typename Parent::LowerNode LowerNode;
    364364    typedef typename Parent::Edge Edge;
    365     typedef typename Parent::UndirEdge UndirEdge;
     365    typedef typename Parent::UEdge UEdge;
    366366   
    367367    template <typename _Value>
     
    369369      : public IterableMapExtender<DefaultMap<Graph, UpperNode, _Value> > {
    370370    public:
    371       typedef MappableUndirBipartiteGraphExtender Graph;
     371      typedef MappableUBipartiteGraphExtender Graph;
    372372      typedef IterableMapExtender<DefaultMap<Graph, UpperNode, _Value> >
    373373      Parent;
     
    406406      : public IterableMapExtender<DefaultMap<Graph, LowerNode, _Value> > {
    407407    public:
    408       typedef MappableUndirBipartiteGraphExtender Graph;
     408      typedef MappableUBipartiteGraphExtender Graph;
    409409      typedef IterableMapExtender<DefaultMap<Graph, LowerNode, _Value> >
    410410      Parent;
     
    444444    class NodeMapBase : public Parent::NodeNotifier::ObserverBase {
    445445    public:
    446       typedef MappableUndirBipartiteGraphExtender Graph;
     446      typedef MappableUBipartiteGraphExtender Graph;
    447447
    448448      typedef Node Key;
     
    524524      : public IterableMapExtender<NodeMapBase<_Value> > {
    525525    public:
    526       typedef MappableUndirBipartiteGraphExtender Graph;
     526      typedef MappableUBipartiteGraphExtender Graph;
    527527      typedef IterableMapExtender< NodeMapBase<_Value> > Parent;
    528528   
     
    562562      : public IterableMapExtender<DefaultMap<Graph, Edge, _Value> > {
    563563    public:
    564       typedef MappableUndirBipartiteGraphExtender Graph;
     564      typedef MappableUBipartiteGraphExtender Graph;
    565565      typedef IterableMapExtender<DefaultMap<Graph, Edge, _Value> > Parent;
    566566   
     
    587587
    588588    template <typename _Value>
    589     class UndirEdgeMap
    590       : public IterableMapExtender<DefaultMap<Graph, UndirEdge, _Value> > {
    591     public:
    592       typedef MappableUndirBipartiteGraphExtender Graph;
    593       typedef IterableMapExtender<DefaultMap<Graph, UndirEdge, _Value> >
     589    class UEdgeMap
     590      : public IterableMapExtender<DefaultMap<Graph, UEdge, _Value> > {
     591    public:
     592      typedef MappableUBipartiteGraphExtender Graph;
     593      typedef IterableMapExtender<DefaultMap<Graph, UEdge, _Value> >
    594594      Parent;
    595595   
    596       UndirEdgeMap(const Graph& _g)
    597         : Parent(_g) {}
    598       UndirEdgeMap(const Graph& _g, const _Value& _v)
    599         : Parent(_g, _v) {}
    600    
    601       UndirEdgeMap& operator=(const UndirEdgeMap& cmap) {
    602         return operator=<UndirEdgeMap>(cmap);
    603       }
    604    
    605       template <typename CMap>
    606       UndirEdgeMap& operator=(const CMap& cmap) {
    607         checkConcept<concept::ReadMap<UndirEdge, _Value>, CMap>();
    608         const typename Parent::Graph* graph = Parent::getGraph();
    609         UndirEdge it;
     596      UEdgeMap(const Graph& _g)
     597        : Parent(_g) {}
     598      UEdgeMap(const Graph& _g, const _Value& _v)
     599        : Parent(_g, _v) {}
     600   
     601      UEdgeMap& operator=(const UEdgeMap& cmap) {
     602        return operator=<UEdgeMap>(cmap);
     603      }
     604   
     605      template <typename CMap>
     606      UEdgeMap& operator=(const CMap& cmap) {
     607        checkConcept<concept::ReadMap<UEdge, _Value>, CMap>();
     608        const typename Parent::Graph* graph = Parent::getGraph();
     609        UEdge it;
    610610        for (graph->first(it); it != INVALID; graph->next(it)) {
    611611          Parent::set(it, cmap[it]);
Note: See TracChangeset for help on using the changeset viewer.