COIN-OR::LEMON - Graph Library

Changeset 592:e72bacfea6b7 in lemon


Ignore:
Timestamp:
02/25/09 12:10:57 (10 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Phase:
public
Message:

Remane GomoryHuTree? to GomoryHu? (#66)

Files:
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • lemon/Makefile.am

    r590 r592  
    6969        lemon/full_graph.h \
    7070        lemon/glpk.h \
    71         lemon/gomory_hu_tree.h \
     71        lemon/gomory_hu.h \
    7272        lemon/graph_to_eps.h \
    7373        lemon/grid_graph.h \
  • lemon/gomory_hu.h

    r591 r592  
    6464            typename CAP = typename GR::template EdgeMap<int>
    6565            >
    66   class GomoryHuTree {
     66  class GomoryHu {
    6767  public:
    6868
     
    117117    /// \param graph The graph the algorithm will run on.
    118118    /// \param capacity The capacity map.
    119     GomoryHuTree(const Graph& graph, const Capacity& capacity)
     119    GomoryHu(const Graph& graph, const Capacity& capacity)
    120120      : _graph(graph), _capacity(capacity),
    121121        _pred(0), _weight(0), _order(0)
     
    128128    ///
    129129    /// Destructor
    130     ~GomoryHuTree() {
     130    ~GomoryHu() {
    131131      destroyStructures();
    132132    }
     
    341341   
    342342    /// This iterator class lists the nodes of a minimum cut found by
    343     /// GomoryHuTree. Before using it, you must allocate a GomoryHuTree class,
    344     /// and call its \ref GomoryHuTree::run() "run()" method.
     343    /// GomoryHu. Before using it, you must allocate a GomoryHu class,
     344    /// and call its \ref GomoryHu::run() "run()" method.
    345345    ///
    346346    /// This example counts the nodes in the minimum cut separating \c s from
    347347    /// \c t.
    348348    /// \code
    349     /// GomoruHuTree<Graph> gom(g, capacities);
     349    /// GomoruHu<Graph> gom(g, capacities);
    350350    /// gom.run();
    351351    /// int sum=0;
    352     /// for(GomoruHuTree<Graph>::MinCutNodeIt n(gom,s,t);n!=INVALID;++n) ++sum;
     352    /// for(GomoruHu<Graph>::MinCutNodeIt n(gom,s,t);n!=INVALID;++n) ++sum;
    353353    /// \endcode
    354354    class MinCutNodeIt
     
    362362      /// Constructor
    363363      ///
    364       MinCutNodeIt(GomoryHuTree const &gomory,
    365                    ///< The GomoryHuTree class. You must call its
     364      MinCutNodeIt(GomoryHu const &gomory,
     365                   ///< The GomoryHu class. You must call its
    366366                   ///  run() method
    367367                   ///  before initializing this iterator
     
    438438   
    439439    /// This iterator class lists the edges of a minimum cut found by
    440     /// GomoryHuTree. Before using it, you must allocate a GomoryHuTree class,
    441     /// and call its \ref GomoryHuTree::run() "run()" method.
     440    /// GomoryHu. Before using it, you must allocate a GomoryHu class,
     441    /// and call its \ref GomoryHu::run() "run()" method.
    442442    ///
    443443    /// This example computes the value of the minimum cut separating \c s from
    444444    /// \c t.
    445445    /// \code
    446     /// GomoruHuTree<Graph> gom(g, capacities);
     446    /// GomoruHu<Graph> gom(g, capacities);
    447447    /// gom.run();
    448448    /// int value=0;
    449     /// for(GomoruHuTree<Graph>::MinCutEdgeIt e(gom,s,t);e!=INVALID;++e)
     449    /// for(GomoruHu<Graph>::MinCutEdgeIt e(gom,s,t);e!=INVALID;++e)
    450450    ///   value+=capacities[e];
    451451    /// \endcode
    452452    /// the result will be the same as it is returned by
    453     /// \ref GomoryHuTree::minCostValue() "gom.minCostValue(s,t)"
     453    /// \ref GomoryHu::minCostValue() "gom.minCostValue(s,t)"
    454454    class MinCutEdgeIt
    455455    {
     
    471471     
    472472    public:
    473       MinCutEdgeIt(GomoryHuTree const &gomory,
    474                    ///< The GomoryHuTree class. You must call its
     473      MinCutEdgeIt(GomoryHu const &gomory,
     474                   ///< The GomoryHu class. You must call its
    475475                   ///  run() method
    476476                   ///  before initializing this iterator
  • test/gomory_hu_test.cc

    r591 r592  
    44#include <lemon/smart_graph.h>
    55#include <lemon/lgf_reader.h>
    6 #include <lemon/gomory_hu_tree.h>
     6#include <lemon/gomory_hu.h>
    77#include <cstdlib>
    88
     
    6161    edgeMap("capacity", capacity).run();
    6262
    63   GomoryHuTree<Graph> ght(graph, capacity);
     63  GomoryHu<Graph> ght(graph, capacity);
    6464  ght.init();
    6565  ght.run();
     
    7676
    7777      int sum=0;
    78       for(GomoryHuTree<Graph>::MinCutEdgeIt a(ght, u, v);a!=INVALID;++a)
     78      for(GomoryHu<Graph>::MinCutEdgeIt a(ght, u, v);a!=INVALID;++a)
    7979        sum+=capacity[a];
    8080      check(sum == ght.minCutValue(u, v), "Problem with MinCutEdgeIt");
    8181
    8282      sum=0;
    83       for(GomoryHuTree<Graph>::MinCutNodeIt n(ght, u, v,true);n!=INVALID;++n)
     83      for(GomoryHu<Graph>::MinCutNodeIt n(ght, u, v,true);n!=INVALID;++n)
    8484        sum++;
    85       for(GomoryHuTree<Graph>::MinCutNodeIt n(ght, u, v,false);n!=INVALID;++n)
     85      for(GomoryHu<Graph>::MinCutNodeIt n(ght, u, v,false);n!=INVALID;++n)
    8686        sum++;
    8787      check(sum == countNodes(graph), "Problem with MinCutNodeIt");
Note: See TracChangeset for help on using the changeset viewer.