COIN-OR::LEMON - Graph Library

Ticket #67: adap2-rename-residual-acfb0f24d178.patch

File adap2-rename-residual-acfb0f24d178.patch, 4.1 KB (added by Peter Kovacs, 11 years ago)
  • lemon/adaptors.h

    # HG changeset patch
    # User Peter Kovacs <kpeter@inf.elte.hu>
    # Date 1231743930 -3600
    # Node ID acfb0f24d17825ed47b1e1882232bba3c292113c
    # Parent  a2fd8b8d0b302322691883947286aeee36fcfa65
    Rename Residual to ResidualDigraph (#67)
    The new name is more analogous to other adaptor names.
    
    diff --git a/lemon/adaptors.h b/lemon/adaptors.h
    a b  
    26662666  /// \brief Adaptor class for composing the residual digraph for directed
    26672667  /// flow and circulation problems.
    26682668  ///
    2669   /// Residual can be used for composing the \e residual digraph for directed
    2670   /// flow and circulation problems. Let \f$ G=(V, A) \f$ be a directed graph
    2671   /// and let \f$ F \f$ be a number type. Let \f$ flow, cap: A\to F \f$ be
    2672   /// functions on the arcs.
     2669  /// ResidualDigraph can be used for composing the \e residual digraph
     2670  /// for directed flow and circulation problems. Let \f$ G=(V, A) \f$
     2671  /// be a directed graph and let \f$ F \f$ be a number type.
     2672  /// Let \f$ flow, cap: A\to F \f$ be functions on the arcs.
    26732673  /// This adaptor implements a digraph structure with node set \f$ V \f$
    26742674  /// and arc set \f$ A_{forward}\cup A_{backward} \f$,
    26752675  /// where \f$ A_{forward}=\{uv : uv\in A, flow(uv)<cap(uv)\} \f$ and
     
    27042704  /// is convertible to the \c Arc type of the adapted digraph.
    27052705#ifdef DOXYGEN
    27062706  template<typename GR, typename CM, typename FM, typename TL>
    2707   class Residual
     2707  class ResidualDigraph
    27082708#else
    27092709  template<typename GR,
    27102710           typename CM = typename GR::template ArcMap<int>,
    27112711           typename FM = CM,
    27122712           typename TL = Tolerance<typename CM::Value> >
    2713   class Residual :
     2713  class ResidualDigraph :
    27142714    public FilterArcs<
    27152715      Undirector<const GR>,
    27162716      typename Undirector<const GR>::template CombinedArcMap<
     
    27302730    typedef TL Tolerance;
    27312731
    27322732    typedef typename CapacityMap::Value Value;
    2733     typedef Residual Adaptor;
     2733    typedef ResidualDigraph Adaptor;
    27342734
    27352735  protected:
    27362736
     
    27612761    ///
    27622762    /// Constructor of the residual digraph adaptor. The parameters are the
    27632763    /// digraph, the capacity map, the flow map, and a tolerance object.
    2764     Residual(const Digraph& digraph, const CapacityMap& capacity,
    2765              FlowMap& flow, const Tolerance& tolerance = Tolerance())
     2764    ResidualDigraph(const Digraph& digraph, const CapacityMap& capacity,
     2765                    FlowMap& flow, const Tolerance& tolerance = Tolerance())
    27662766      : Parent(), _capacity(&capacity), _flow(&flow), _graph(digraph),
    27672767        _forward_filter(capacity, flow, tolerance),
    27682768        _backward_filter(capacity, flow, tolerance),
     
    28692869  /// \ingroup graph_adaptors
    28702870  /// \relates Residual
    28712871  template<typename GR, typename CM, typename FM>
    2872   Residual<GR, CM, FM> residual(const GR& digraph,
    2873                                 const CM& capacity_map,
    2874                                 FM& flow_map) {
    2875     return Residual<GR, CM, FM> (digraph, capacity_map, flow_map);
     2872  ResidualDigraph<GR, CM, FM>
     2873  residualDigraph(const GR& digraph, const CM& capacity_map, FM& flow_map) {
     2874    return ResidualDigraph<GR, CM, FM> (digraph, capacity_map, flow_map);
    28762875  }
    28772876
    28782877
  • test/graph_adaptor_test.cc

    diff --git a/test/graph_adaptor_test.cc b/test/graph_adaptor_test.cc
    a b  
    581581  ea = a2;
    582582}
    583583
    584 void checkResidual() {
     584void checkResidualDigraph() {
    585585  // Check concepts
    586   checkConcept<concepts::Digraph, Residual<concepts::Digraph> >();
    587   checkConcept<concepts::Digraph, Residual<ListDigraph> >();
     586  checkConcept<concepts::Digraph, ResidualDigraph<concepts::Digraph> >();
     587  checkConcept<concepts::Digraph, ResidualDigraph<ListDigraph> >();
    588588
    589589  // Create a digraph and an adaptor
    590590  typedef ListDigraph Digraph;
    591591  typedef Digraph::ArcMap<int> IntArcMap;
    592   typedef Residual<Digraph, IntArcMap> Adaptor;
     592  typedef ResidualDigraph<Digraph, IntArcMap> Adaptor;
    593593
    594594  Digraph digraph;
    595595  IntArcMap capacity(digraph), flow(digraph);
     
    14701470  checkFilterNodes1();
    14711471  checkFilterArcs();
    14721472  checkUndirector();
    1473   checkResidual();
     1473  checkResidualDigraph();
    14741474  checkSplitNodes();
    14751475
    14761476  // Check the graph adaptors (using ListGraph)