COIN-OR::LEMON - Graph Library

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/adaptors.h

    r1081 r703  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2011
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    419419      Parent::initialize(digraph);
    420420      _node_filter = &node_filter;
    421       _arc_filter = &arc_filter;
     421      _arc_filter = &arc_filter;     
    422422    }
    423423
     
    506506
    507507    template <typename V>
    508     class NodeMap
    509       : public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
    510               LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> {
     508    class NodeMap 
     509      : public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>, 
     510              LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> {
    511511      typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
    512         LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent;
     512        LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent;
    513513
    514514    public:
     
    533533
    534534    template <typename V>
    535     class ArcMap
     535    class ArcMap 
    536536      : public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
    537               LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> {
     537              LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> {
    538538      typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
    539539        LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> Parent;
     
    580580      Parent::initialize(digraph);
    581581      _node_filter = &node_filter;
    582       _arc_filter = &arc_filter;
     582      _arc_filter = &arc_filter;     
    583583    }
    584584
     
    649649
    650650    template <typename V>
    651     class NodeMap
     651    class NodeMap 
    652652      : public SubMapExtender<SubDigraphBase<DGR, NF, AF, false>,
    653653          LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> {
    654       typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, false>,
     654      typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, false>, 
    655655        LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent;
    656656
     
    676676
    677677    template <typename V>
    678     class ArcMap
     678    class ArcMap 
    679679      : public SubMapExtender<SubDigraphBase<DGR, NF, AF, false>,
    680680          LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> {
     
    10171017
    10181018    template <typename V>
    1019     class NodeMap
     1019    class NodeMap 
    10201020      : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
    10211021          LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> {
    1022       typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
     1022      typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 
    10231023        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> Parent;
    10241024
     
    10441044
    10451045    template <typename V>
    1046     class ArcMap
     1046    class ArcMap 
    10471047      : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
    10481048          LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> {
    1049       typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
     1049      typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 
    10501050        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> Parent;
    10511051
     
    10711071
    10721072    template <typename V>
    1073     class EdgeMap
     1073    class EdgeMap 
    10741074      : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
    10751075        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> {
    1076       typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
     1076      typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 
    10771077        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent;
    10781078
     
    11131113    NF* _node_filter;
    11141114    EF* _edge_filter;
    1115     SubGraphBase()
    1116           : Parent(), _node_filter(0), _edge_filter(0) { }
     1115    SubGraphBase() 
     1116          : Parent(), _node_filter(0), _edge_filter(0) { }
    11171117
    11181118    void initialize(GR& graph, NF& node_filter, EF& edge_filter) {
     
    12151215
    12161216    template <typename V>
    1217     class NodeMap
     1217    class NodeMap 
    12181218      : public SubMapExtender<SubGraphBase<GR, NF, EF, false>,
    12191219          LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> {
    1220       typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>,
     1220      typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 
    12211221        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> Parent;
    12221222
     
    12421242
    12431243    template <typename V>
    1244     class ArcMap
     1244    class ArcMap 
    12451245      : public SubMapExtender<SubGraphBase<GR, NF, EF, false>,
    12461246          LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> {
    1247       typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>,
     1247      typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 
    12481248        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> Parent;
    12491249
     
    12691269
    12701270    template <typename V>
    1271     class EdgeMap
     1271    class EdgeMap 
    12721272      : public SubMapExtender<SubGraphBase<GR, NF, EF, false>,
    12731273        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> {
    1274       typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>,
    1275         LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent;
     1274      typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 
     1275        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent;
    12761276
    12771277    public:
     
    14961496#endif
    14971497    typedef DigraphAdaptorExtender<
    1498       SubDigraphBase<GR, NF, ConstMap<typename GR::Arc, Const<bool, true> >,
     1498      SubDigraphBase<GR, NF, ConstMap<typename GR::Arc, Const<bool, true> >, 
    14991499                     true> > Parent;
    15001500
     
    15171517    /// Creates a subgraph for the given digraph or graph with the
    15181518    /// given node filter map.
    1519     FilterNodes(GR& graph, NF& node_filter)
     1519    FilterNodes(GR& graph, NF& node_filter) 
    15201520      : Parent(), const_true_map()
    15211521    {
     
    15551555                    typename enable_if<UndirectedTagIndicator<GR> >::type> :
    15561556    public GraphAdaptorExtender<
    1557       SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >,
     1557      SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >, 
    15581558                   true> > {
    15591559
    15601560    typedef GraphAdaptorExtender<
    1561       SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >,
     1561      SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >, 
    15621562                   true> > Parent;
    15631563
     
    16431643#endif
    16441644    typedef DigraphAdaptorExtender<
    1645       SubDigraphBase<DGR, ConstMap<typename DGR::Node, Const<bool, true> >,
     1645      SubDigraphBase<DGR, ConstMap<typename DGR::Node, Const<bool, true> >, 
    16461646                     AF, false> > Parent;
    16471647
     
    17491749  class FilterEdges :
    17501750    public GraphAdaptorExtender<
    1751       SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true> >,
     1751      SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true> >, 
    17521752                   EF, false> > {
    17531753#endif
    17541754    typedef GraphAdaptorExtender<
    1755       SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true > >,
     1755      SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true > >, 
    17561756                   EF, false> > Parent;
    17571757
     
    17781778    /// Creates a subgraph for the given graph with the given edge
    17791779    /// filter map.
    1780     FilterEdges(GR& graph, EF& edge_filter)
     1780    FilterEdges(GR& graph, EF& edge_filter) 
    17811781      : Parent(), const_true_map() {
    17821782      Parent::initialize(graph, const_true_map, edge_filter);
     
    18461846      bool _forward;
    18471847
    1848       Arc(const Edge& edge, bool forward)
     1848      Arc(const Edge& edge, bool forward) 
    18491849        : _edge(edge), _forward(forward) {}
    18501850
     
    20862086
    20872087      ArcMapBase(const UndirectorBase<DGR>& adaptor, const V& value)
    2088         : _forward(*adaptor._digraph, value),
     2088        : _forward(*adaptor._digraph, value), 
    20892089          _backward(*adaptor._digraph, value) {}
    20902090
     
    22042204    typedef typename ItemSetTraits<DGR, Edge>::ItemNotifier EdgeNotifier;
    22052205    EdgeNotifier& notifier(Edge) const { return _digraph->notifier(Edge()); }
    2206 
     2206   
    22072207    typedef EdgeNotifier ArcNotifier;
    22082208    ArcNotifier& notifier(Arc) const { return _digraph->notifier(Edge()); }
     
    27082708           typename FM = CM,
    27092709           typename TL = Tolerance<typename CM::Value> >
    2710   class ResidualDigraph
     2710  class ResidualDigraph 
    27112711    : public SubDigraph<
    27122712        Undirector<const DGR>,
     
    27652765    ResidualDigraph(const DGR& digraph, const CM& capacity,
    27662766                    FM& flow, const TL& tolerance = Tolerance())
    2767       : Parent(), _capacity(&capacity), _flow(&flow),
     2767      : Parent(), _capacity(&capacity), _flow(&flow), 
    27682768        _graph(digraph), _node_filter(),
    27692769        _forward_filter(capacity, flow, tolerance),
     
    28472847
    28482848      /// Constructor
    2849       ResidualCapacity(const ResidualDigraph<DGR, CM, FM, TL>& adaptor)
     2849      ResidualCapacity(const ResidualDigraph<DGR, CM, FM, TL>& adaptor) 
    28502850        : _adaptor(&adaptor) {}
    28512851
     
    34243424    /// to get a node map of the split digraph.
    34253425    /// Its value type is inherited from the first node map type (\c IN).
    3426     /// \tparam IN The type of the node map for the in-nodes.
     3426    /// \tparam IN The type of the node map for the in-nodes. 
    34273427    /// \tparam OUT The type of the node map for the out-nodes.
    34283428    template <typename IN, typename OUT>
Note: See TracChangeset for help on using the changeset viewer.