diff --git a/lemon/Makefile.am b/lemon/Makefile.am --- a/lemon/Makefile.am +++ b/lemon/Makefile.am @@ -68,7 +68,7 @@ lemon/euler.h \ lemon/full_graph.h \ lemon/glpk.h \ - lemon/gomory_hu_tree.h \ + lemon/gomory_hu.h \ lemon/graph_to_eps.h \ lemon/grid_graph.h \ lemon/hypercube_graph.h \ diff --git a/lemon/gomory_hu_tree.h b/lemon/gomory_hu.h rename from lemon/gomory_hu_tree.h rename to lemon/gomory_hu.h --- a/lemon/gomory_hu_tree.h +++ b/lemon/gomory_hu.h @@ -63,7 +63,7 @@ template > - class GomoryHuTree { + class GomoryHu { public: /// The graph type @@ -116,7 +116,7 @@ /// Constructor /// \param graph The graph the algorithm will run on. /// \param capacity The capacity map. - GomoryHuTree(const Graph& graph, const Capacity& capacity) + GomoryHu(const Graph& graph, const Capacity& capacity) : _graph(graph), _capacity(capacity), _pred(0), _weight(0), _order(0) { @@ -127,7 +127,7 @@ /// \brief Destructor /// /// Destructor - ~GomoryHuTree() { + ~GomoryHu() { destroyStructures(); } @@ -340,16 +340,16 @@ /// Iterate on the nodes of a minimum cut /// This iterator class lists the nodes of a minimum cut found by - /// GomoryHuTree. Before using it, you must allocate a GomoryHuTree class, - /// and call its \ref GomoryHuTree::run() "run()" method. + /// GomoryHu. Before using it, you must allocate a GomoryHu class, + /// and call its \ref GomoryHu::run() "run()" method. /// /// This example counts the nodes in the minimum cut separating \c s from /// \c t. /// \code - /// GomoruHuTree gom(g, capacities); + /// GomoruHu gom(g, capacities); /// gom.run(); /// int sum=0; - /// for(GomoruHuTree::MinCutNodeIt n(gom,s,t);n!=INVALID;++n) ++sum; + /// for(GomoruHu::MinCutNodeIt n(gom,s,t);n!=INVALID;++n) ++sum; /// \endcode class MinCutNodeIt { @@ -361,8 +361,8 @@ /// Constructor /// - MinCutNodeIt(GomoryHuTree const &gomory, - ///< The GomoryHuTree class. You must call its + MinCutNodeIt(GomoryHu const &gomory, + ///< The GomoryHu class. You must call its /// run() method /// before initializing this iterator const Node& s, ///< Base node @@ -437,20 +437,20 @@ /// Iterate on the edges of a minimum cut /// This iterator class lists the edges of a minimum cut found by - /// GomoryHuTree. Before using it, you must allocate a GomoryHuTree class, - /// and call its \ref GomoryHuTree::run() "run()" method. + /// GomoryHu. Before using it, you must allocate a GomoryHu class, + /// and call its \ref GomoryHu::run() "run()" method. /// /// This example computes the value of the minimum cut separating \c s from /// \c t. /// \code - /// GomoruHuTree gom(g, capacities); + /// GomoruHu gom(g, capacities); /// gom.run(); /// int value=0; - /// for(GomoruHuTree::MinCutEdgeIt e(gom,s,t);e!=INVALID;++e) + /// for(GomoruHu::MinCutEdgeIt e(gom,s,t);e!=INVALID;++e) /// value+=capacities[e]; /// \endcode /// the result will be the same as it is returned by - /// \ref GomoryHuTree::minCostValue() "gom.minCostValue(s,t)" + /// \ref GomoryHu::minCostValue() "gom.minCostValue(s,t)" class MinCutEdgeIt { bool _side; @@ -470,8 +470,8 @@ } public: - MinCutEdgeIt(GomoryHuTree const &gomory, - ///< The GomoryHuTree class. You must call its + MinCutEdgeIt(GomoryHu const &gomory, + ///< The GomoryHu class. You must call its /// run() method /// before initializing this iterator const Node& s, ///< Base node diff --git a/test/gomory_hu_test.cc b/test/gomory_hu_test.cc --- a/test/gomory_hu_test.cc +++ b/test/gomory_hu_test.cc @@ -3,7 +3,7 @@ #include "test_tools.h" #include #include -#include +#include #include using namespace std; @@ -60,7 +60,7 @@ GraphReader(graph, input). edgeMap("capacity", capacity).run(); - GomoryHuTree ght(graph, capacity); + GomoryHu ght(graph, capacity); ght.init(); ght.run(); @@ -75,14 +75,14 @@ check(pf.flowValue() == cutValue(graph, cm, capacity), "Wrong cut 2"); int sum=0; - for(GomoryHuTree::MinCutEdgeIt a(ght, u, v);a!=INVALID;++a) + for(GomoryHu::MinCutEdgeIt a(ght, u, v);a!=INVALID;++a) sum+=capacity[a]; check(sum == ght.minCutValue(u, v), "Problem with MinCutEdgeIt"); sum=0; - for(GomoryHuTree::MinCutNodeIt n(ght, u, v,true);n!=INVALID;++n) + for(GomoryHu::MinCutNodeIt n(ght, u, v,true);n!=INVALID;++n) sum++; - for(GomoryHuTree::MinCutNodeIt n(ght, u, v,false);n!=INVALID;++n) + for(GomoryHu::MinCutNodeIt n(ght, u, v,false);n!=INVALID;++n) sum++; check(sum == countNodes(graph), "Problem with MinCutNodeIt");