COIN-OR::LEMON - Graph Library

Changeset 877:141f9c0db4a3 in lemon-main for lemon/adaptors.h


Ignore:
Timestamp:
03/06/10 15:35:12 (14 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Children:
879:38213abd2911, 931:f112c18bc304
Phase:
public
Message:

Unify the sources (#339)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/adaptors.h

    r787 r877  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2010
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    422422      Parent::initialize(digraph);
    423423      _node_filter = &node_filter;
    424       _arc_filter = &arc_filter;     
     424      _arc_filter = &arc_filter;
    425425    }
    426426
     
    509509
    510510    template <typename V>
    511     class NodeMap 
    512       : public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>, 
    513               LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> {
     511    class NodeMap
     512      : public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
     513              LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> {
    514514      typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
    515         LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent;
     515        LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent;
    516516
    517517    public:
     
    536536
    537537    template <typename V>
    538     class ArcMap 
     538    class ArcMap
    539539      : public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
    540               LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> {
     540              LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> {
    541541      typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
    542542        LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> Parent;
     
    583583      Parent::initialize(digraph);
    584584      _node_filter = &node_filter;
    585       _arc_filter = &arc_filter;     
     585      _arc_filter = &arc_filter;
    586586    }
    587587
     
    652652
    653653    template <typename V>
    654     class NodeMap 
     654    class NodeMap
    655655      : public SubMapExtender<SubDigraphBase<DGR, NF, AF, false>,
    656656          LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> {
    657       typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, false>, 
     657      typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, false>,
    658658        LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent;
    659659
     
    679679
    680680    template <typename V>
    681     class ArcMap 
     681    class ArcMap
    682682      : public SubMapExtender<SubDigraphBase<DGR, NF, AF, false>,
    683683          LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> {
     
    10221022
    10231023    template <typename V>
    1024     class NodeMap 
     1024    class NodeMap
    10251025      : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
    10261026          LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> {
    1027       typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 
     1027      typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
    10281028        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> Parent;
    10291029
     
    10491049
    10501050    template <typename V>
    1051     class ArcMap 
     1051    class ArcMap
    10521052      : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
    10531053          LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> {
    1054       typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 
     1054      typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
    10551055        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> Parent;
    10561056
     
    10761076
    10771077    template <typename V>
    1078     class EdgeMap 
     1078    class EdgeMap
    10791079      : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
    10801080        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> {
    1081       typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 
     1081      typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
    10821082        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent;
    10831083
     
    11181118    NF* _node_filter;
    11191119    EF* _edge_filter;
    1120     SubGraphBase() 
    1121           : Parent(), _node_filter(0), _edge_filter(0) { }
     1120    SubGraphBase()
     1121          : Parent(), _node_filter(0), _edge_filter(0) { }
    11221122
    11231123    void initialize(GR& graph, NF& node_filter, EF& edge_filter) {
     
    12201220
    12211221    template <typename V>
    1222     class NodeMap 
     1222    class NodeMap
    12231223      : public SubMapExtender<SubGraphBase<GR, NF, EF, false>,
    12241224          LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> {
    1225       typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 
     1225      typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>,
    12261226        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> Parent;
    12271227
     
    12471247
    12481248    template <typename V>
    1249     class ArcMap 
     1249    class ArcMap
    12501250      : public SubMapExtender<SubGraphBase<GR, NF, EF, false>,
    12511251          LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> {
    1252       typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 
     1252      typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>,
    12531253        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> Parent;
    12541254
     
    12741274
    12751275    template <typename V>
    1276     class EdgeMap 
     1276    class EdgeMap
    12771277      : public SubMapExtender<SubGraphBase<GR, NF, EF, false>,
    12781278        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> {
    1279       typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 
    1280         LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent;
     1279      typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>,
     1280        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent;
    12811281
    12821282    public:
     
    15051505#endif
    15061506    typedef DigraphAdaptorExtender<
    1507       SubDigraphBase<GR, NF, ConstMap<typename GR::Arc, Const<bool, true> >, 
     1507      SubDigraphBase<GR, NF, ConstMap<typename GR::Arc, Const<bool, true> >,
    15081508                     true> > Parent;
    15091509
     
    15261526    /// Creates a subgraph for the given digraph or graph with the
    15271527    /// given node filter map.
    1528     FilterNodes(GR& graph, NF& node_filter) 
     1528    FilterNodes(GR& graph, NF& node_filter)
    15291529      : Parent(), const_true_map()
    15301530    {
     
    15641564                    typename enable_if<UndirectedTagIndicator<GR> >::type> :
    15651565    public GraphAdaptorExtender<
    1566       SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >, 
     1566      SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >,
    15671567                   true> > {
    15681568
    15691569    typedef GraphAdaptorExtender<
    1570       SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >, 
     1570      SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >,
    15711571                   true> > Parent;
    15721572
     
    16541654#endif
    16551655    typedef DigraphAdaptorExtender<
    1656       SubDigraphBase<DGR, ConstMap<typename DGR::Node, Const<bool, true> >, 
     1656      SubDigraphBase<DGR, ConstMap<typename DGR::Node, Const<bool, true> >,
    16571657                     AF, false> > Parent;
    16581658
     
    17621762  class FilterEdges :
    17631763    public GraphAdaptorExtender<
    1764       SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true> >, 
     1764      SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true> >,
    17651765                   EF, false> > {
    17661766#endif
    17671767    typedef GraphAdaptorExtender<
    1768       SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true > >, 
     1768      SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true > >,
    17691769                   EF, false> > Parent;
    17701770
     
    17911791    /// Creates a subgraph for the given graph with the given edge
    17921792    /// filter map.
    1793     FilterEdges(GR& graph, EF& edge_filter) 
     1793    FilterEdges(GR& graph, EF& edge_filter)
    17941794      : Parent(), const_true_map() {
    17951795      Parent::initialize(graph, const_true_map, edge_filter);
     
    18591859      bool _forward;
    18601860
    1861       Arc(const Edge& edge, bool forward) 
     1861      Arc(const Edge& edge, bool forward)
    18621862        : _edge(edge), _forward(forward) {}
    18631863
     
    20992099
    21002100      ArcMapBase(const UndirectorBase<DGR>& adaptor, const V& value)
    2101         : _forward(*adaptor._digraph, value), 
     2101        : _forward(*adaptor._digraph, value),
    21022102          _backward(*adaptor._digraph, value) {}
    21032103
     
    22172217    typedef typename ItemSetTraits<DGR, Edge>::ItemNotifier EdgeNotifier;
    22182218    EdgeNotifier& notifier(Edge) const { return _digraph->notifier(Edge()); }
    2219    
     2219
    22202220    typedef EdgeNotifier ArcNotifier;
    22212221    ArcNotifier& notifier(Arc) const { return _digraph->notifier(Edge()); }
     
    27292729           typename FM = CM,
    27302730           typename TL = Tolerance<typename CM::Value> >
    2731   class ResidualDigraph 
     2731  class ResidualDigraph
    27322732    : public SubDigraph<
    27332733        Undirector<const DGR>,
     
    27862786    ResidualDigraph(const DGR& digraph, const CM& capacity,
    27872787                    FM& flow, const TL& tolerance = Tolerance())
    2788       : Parent(), _capacity(&capacity), _flow(&flow), 
     2788      : Parent(), _capacity(&capacity), _flow(&flow),
    27892789        _graph(digraph), _node_filter(),
    27902790        _forward_filter(capacity, flow, tolerance),
     
    28682868
    28692869      /// Constructor
    2870       ResidualCapacity(const ResidualDigraph<DGR, CM, FM, TL>& adaptor) 
     2870      ResidualCapacity(const ResidualDigraph<DGR, CM, FM, TL>& adaptor)
    28712871        : _adaptor(&adaptor) {}
    28722872
     
    34483448    /// to get a node map of the split digraph.
    34493449    /// Its value type is inherited from the first node map type (\c IN).
    3450     /// \tparam IN The type of the node map for the in-nodes. 
     3450    /// \tparam IN The type of the node map for the in-nodes.
    34513451    /// \tparam OUT The type of the node map for the out-nodes.
    34523452    template <typename IN, typename OUT>
Note: See TracChangeset for help on using the changeset viewer.