[Lemon-commits] Alpar Juttner: Remane GomoryHuTree to GomoryHu (...
Lemon HG
hg at lemon.cs.elte.hu
Wed Mar 4 16:35:20 CET 2009
details: http://lemon.cs.elte.hu/hg/lemon/rev/e72bacfea6b7
changeset: 567:e72bacfea6b7
user: Alpar Juttner <alpar [at] cs.elte.hu>
date: Wed Feb 25 11:10:57 2009 +0000
description:
Remane GomoryHuTree to GomoryHu (#66)
diffstat:
3 files changed, 22 insertions(+), 22 deletions(-)
lemon/Makefile.am | 2 +-
lemon/gomory_hu.h | 32 ++++++++++++++++----------------
test/gomory_hu_test.cc | 10 +++++-----
diffs (152 lines):
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 <typename GR,
typename CAP = typename GR::template EdgeMap<int>
>
- 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<Graph> gom(g, capacities);
+ /// GomoruHu<Graph> gom(g, capacities);
/// gom.run();
/// int sum=0;
- /// for(GomoruHuTree<Graph>::MinCutNodeIt n(gom,s,t);n!=INVALID;++n) ++sum;
+ /// for(GomoruHu<Graph>::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<Graph> gom(g, capacities);
+ /// GomoruHu<Graph> gom(g, capacities);
/// gom.run();
/// int value=0;
- /// for(GomoruHuTree<Graph>::MinCutEdgeIt e(gom,s,t);e!=INVALID;++e)
+ /// for(GomoruHu<Graph>::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 <lemon/smart_graph.h>
#include <lemon/lgf_reader.h>
-#include <lemon/gomory_hu_tree.h>
+#include <lemon/gomory_hu.h>
#include <cstdlib>
using namespace std;
@@ -60,7 +60,7 @@
GraphReader<Graph>(graph, input).
edgeMap("capacity", capacity).run();
- GomoryHuTree<Graph> ght(graph, capacity);
+ GomoryHu<Graph> 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<Graph>::MinCutEdgeIt a(ght, u, v);a!=INVALID;++a)
+ for(GomoryHu<Graph>::MinCutEdgeIt a(ght, u, v);a!=INVALID;++a)
sum+=capacity[a];
check(sum == ght.minCutValue(u, v), "Problem with MinCutEdgeIt");
sum=0;
- for(GomoryHuTree<Graph>::MinCutNodeIt n(ght, u, v,true);n!=INVALID;++n)
+ for(GomoryHu<Graph>::MinCutNodeIt n(ght, u, v,true);n!=INVALID;++n)
sum++;
- for(GomoryHuTree<Graph>::MinCutNodeIt n(ght, u, v,false);n!=INVALID;++n)
+ for(GomoryHu<Graph>::MinCutNodeIt n(ght, u, v,false);n!=INVALID;++n)
sum++;
check(sum == countNodes(graph), "Problem with MinCutNodeIt");
More information about the Lemon-commits
mailing list