COIN-OR::LEMON - Graph Library

Changeset 1979:c2992fd74dad in lemon-0.x for lemon/graph_adaptor.h


Ignore:
Timestamp:
02/22/06 19:26:56 (14 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2569
Message:

Mergeing extendermerge branch
Changes:

the extender system
resize for static size graph
UGraphExtender => UndirectGraphExtender?

UGraphExtenders with changed meaning

Some UGraphExtender /SubUGraphExtenders, DirectUGraphExtender/
GridGraph? => GridUGraph
radix sort to ansi compatible

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/graph_adaptor.h

    r1957 r1979  
    3030#include <lemon/invalid.h>
    3131#include <lemon/maps.h>
    32 #include <lemon/bits/erasable_graph_extender.h>
    33 #include <lemon/bits/clearable_graph_extender.h>
    34 #include <lemon/bits/extendable_graph_extender.h>
    35 #include <lemon/bits/iterable_graph_extender.h>
    36 #include <lemon/bits/alteration_notifier.h>
    37 #include <lemon/bits/default_map.h>
     32
     33#include <lemon/bits/graph_adaptor_extender.h>
    3834#include <lemon/bits/graph_extender.h>
     35
    3936#include <iostream>
    4037
     
    118115    int id(const Edge& e) const { return graph->id(e); }
    119116   
    120     Edge oppositeNode(const Edge& e) const {
    121       return Edge(graph->opposite(e));
    122     }
    123 
    124117    template <typename _Value>
    125118    class NodeMap : public _Graph::template NodeMap<_Value> {
     
    146139  template <typename _Graph>
    147140  class GraphAdaptor :
    148     public IterableGraphExtender<GraphAdaptorBase<_Graph> > {
     141    public GraphAdaptorExtender<GraphAdaptorBase<_Graph> > {
    149142  public:
    150143    typedef _Graph Graph;
    151     typedef IterableGraphExtender<GraphAdaptorBase<_Graph> > Parent;
     144    typedef GraphAdaptorExtender<GraphAdaptorBase<_Graph> > Parent;
    152145  protected:
    153146    GraphAdaptor() : Parent() { }
     
    199192  template<typename _Graph>
    200193  class RevGraphAdaptor :
    201     public IterableGraphExtender<RevGraphAdaptorBase<_Graph> > {
     194    public GraphAdaptorExtender<RevGraphAdaptorBase<_Graph> > {
    202195  public:
    203196    typedef _Graph Graph;
    204     typedef IterableGraphExtender<
     197    typedef GraphAdaptorExtender<
    205198      RevGraphAdaptorBase<_Graph> > Parent;
    206199  protected:
     
    323316    bool hidden(const Edge& e) const { return !(*edge_filter_map)[e]; }
    324317
     318    typedef False FindEdgeTag;
    325319    typedef False NodeNumTag;
    326320    typedef False EdgeNumTag;
     
    429423    bool hidden(const Edge& e) const { return !(*edge_filter_map)[e]; }
    430424
     425    typedef False FindEdgeTag;
    431426    typedef False NodeNumTag;
    432427    typedef False EdgeNumTag;
     
    497492           typename EdgeFilterMap, bool checked = true>
    498493  class SubGraphAdaptor :
    499     public IterableGraphExtender<
     494    public GraphAdaptorExtender<
    500495    SubGraphAdaptorBase<_Graph, NodeFilterMap, EdgeFilterMap, checked> > {
    501496  public:
    502497    typedef _Graph Graph;
    503     typedef IterableGraphExtender<
     498    typedef GraphAdaptorExtender<
    504499      SubGraphAdaptorBase<_Graph, NodeFilterMap, EdgeFilterMap> > Parent;
    505500  protected:
     
    704699
    705700  template <typename _Graph>
    706   class UGraphAdaptorBase :
    707     public UGraphExtender<GraphAdaptorBase<_Graph> > {
     701  class UndirectGraphAdaptorBase :
     702    public UGraphBaseExtender<GraphAdaptorBase<_Graph> > {
    708703  public:
    709704    typedef _Graph Graph;
    710     typedef UGraphExtender<GraphAdaptorBase<_Graph> > Parent;
     705    typedef UGraphBaseExtender<GraphAdaptorBase<_Graph> > Parent;
    711706  protected:
    712     UGraphAdaptorBase() : Parent() { }
     707    UndirectGraphAdaptorBase() : Parent() { }
    713708  public:
    714709    typedef typename Parent::UEdge UEdge;
     
    718713    class EdgeMap {
    719714    protected:
    720       const UGraphAdaptorBase<_Graph>* g;
     715      const UndirectGraphAdaptorBase<_Graph>* g;
    721716      template <typename TT> friend class EdgeMap;
    722717      typename _Graph::template EdgeMap<T> forward_map, backward_map;
     
    725720      typedef Edge Key;
    726721     
    727       EdgeMap(const UGraphAdaptorBase<_Graph>& _g) : g(&_g),
     722      EdgeMap(const UndirectGraphAdaptorBase<_Graph>& _g) : g(&_g),
    728723        forward_map(*(g->graph)), backward_map(*(g->graph)) { }
    729724
    730       EdgeMap(const UGraphAdaptorBase<_Graph>& _g, T a) : g(&_g),
     725      EdgeMap(const UndirectGraphAdaptorBase<_Graph>& _g, T a) : g(&_g),
    731726        forward_map(*(g->graph), a), backward_map(*(g->graph), a) { }
    732727     
     
    754749      typedef UEdge Key;
    755750     
    756       UEdgeMap(const UGraphAdaptorBase<_Graph>& g) :
     751      UEdgeMap(const UndirectGraphAdaptorBase<_Graph>& g) :
    757752        map(*(g.graph)) { }
    758753
    759       UEdgeMap(const UGraphAdaptorBase<_Graph>& g, T a) :
     754      UEdgeMap(const UndirectGraphAdaptorBase<_Graph>& g, T a) :
    760755        map(*(g.graph), a) { }
    761756     
     
    779774  /// \author Marton Makai
    780775  template<typename _Graph>
    781   class UGraphAdaptor :
    782     public IterableUGraphExtender<
    783     UGraphAdaptorBase<_Graph> > {
     776  class UndirectGraphAdaptor :
     777    public UGraphAdaptorExtender<
     778    UndirectGraphAdaptorBase<_Graph> > {
    784779  public:
    785780    typedef _Graph Graph;
    786     typedef IterableUGraphExtender<
    787       UGraphAdaptorBase<_Graph> > Parent;
     781    typedef UGraphAdaptorExtender<
     782      UndirectGraphAdaptorBase<_Graph> > Parent;
    788783  protected:
    789     UGraphAdaptor() { }
    790   public:
    791     UGraphAdaptor(_Graph& _graph) {
     784    UndirectGraphAdaptor() { }
     785  public:
     786    UndirectGraphAdaptor(_Graph& _graph) {
    792787      setGraph(_graph);
    793788    }
     
    10841079           typename ForwardFilterMap, typename BackwardFilterMap>
    10851080  class SubBidirGraphAdaptor :
    1086     public IterableGraphExtender<
     1081    public GraphAdaptorExtender<
    10871082    SubBidirGraphAdaptorBase<_Graph, ForwardFilterMap, BackwardFilterMap> > {
    10881083  public:
    10891084    typedef _Graph Graph;
    1090     typedef IterableGraphExtender<
     1085    typedef GraphAdaptorExtender<
    10911086      SubBidirGraphAdaptorBase<
    10921087      _Graph, ForwardFilterMap, BackwardFilterMap> > Parent;
     
    13421337  template <typename _Graph, typename FirstOutEdgesMap>
    13431338  class ErasingFirstGraphAdaptor :
    1344     public IterableGraphExtender<
     1339    public GraphAdaptorExtender<
    13451340    ErasingFirstGraphAdaptorBase<_Graph, FirstOutEdgesMap> > {
    13461341  public:
    13471342    typedef _Graph Graph;
    1348     typedef IterableGraphExtender<
     1343    typedef GraphAdaptorExtender<
    13491344      ErasingFirstGraphAdaptorBase<_Graph, FirstOutEdgesMap> > Parent;
    13501345    ErasingFirstGraphAdaptor(Graph& _graph,
     
    17121707  template <typename _Graph>
    17131708  class SplitGraphAdaptor
    1714     : public IterableGraphExtender<SplitGraphAdaptorBase<_Graph> > {
    1715   public:
    1716     typedef IterableGraphExtender<SplitGraphAdaptorBase<_Graph> > Parent;
     1709    : public GraphAdaptorExtender<SplitGraphAdaptorBase<_Graph> > {
     1710  public:
     1711    typedef GraphAdaptorExtender<SplitGraphAdaptorBase<_Graph> > Parent;
    17171712
    17181713    SplitGraphAdaptor(_Graph& graph) {
Note: See TracChangeset for help on using the changeset viewer.