[Lemon-commits] Alpar Juttner: Backed out changeset a6eb9698c321...
Lemon HG
hg at lemon.cs.elte.hu
Thu Mar 18 14:21:10 CET 2010
details: http://lemon.cs.elte.hu/hg/lemon/rev/d6052a9c4e8d
changeset: 958:d6052a9c4e8d
user: Alpar Juttner <alpar [at] cs.elte.hu>
date: Thu Mar 18 13:18:58 2010 +0100
description:
Backed out changeset a6eb9698c321 (#360, #51)
diffstat:
lemon/bellman_ford.h | 58 ++---------------------------
test/bellman_ford_test.cc | 1 -
2 files changed, 4 insertions(+), 55 deletions(-)
diffs (116 lines):
diff --git a/lemon/bellman_ford.h b/lemon/bellman_ford.h
--- a/lemon/bellman_ford.h
+++ b/lemon/bellman_ford.h
@@ -28,27 +28,24 @@
#include <lemon/core.h>
#include <lemon/error.h>
#include <lemon/maps.h>
-#include <lemon/tolerance.h>
#include <lemon/path.h>
#include <limits>
namespace lemon {
- /// \brief Default operation traits for the BellmanFord algorithm class.
+ /// \brief Default OperationTraits for the BellmanFord algorithm class.
///
/// This operation traits class defines all computational operations
/// and constants that are used in the Bellman-Ford algorithm.
/// The default implementation is based on the \c numeric_limits class.
/// If the numeric type does not have infinity value, then the maximum
/// value is used as extremal infinity value.
- ///
- /// \see BellmanFordToleranceOperationTraits
template <
typename V,
bool has_inf = std::numeric_limits<V>::has_infinity>
struct BellmanFordDefaultOperationTraits {
- /// \brief Value type for the algorithm.
+ /// \e
typedef V Value;
/// \brief Gives back the zero value of the type.
static Value zero() {
@@ -87,51 +84,6 @@
}
};
- /// \brief Operation traits for the BellmanFord algorithm class
- /// using tolerance.
- ///
- /// This operation traits class defines all computational operations
- /// and constants that are used in the Bellman-Ford algorithm.
- /// The only difference between this implementation and
- /// \ref BellmanFordDefaultOperationTraits is that this class uses
- /// the \ref Tolerance "tolerance technique" in its \ref less()
- /// function.
- ///
- /// \tparam V The value type.
- /// \tparam eps The epsilon value for the \ref less() function.
- /// By default, it is the epsilon value used by \ref Tolerance
- /// "Tolerance<V>".
- ///
- /// \see BellmanFordDefaultOperationTraits
-#ifdef DOXYGEN
- template <typename V, V eps>
-#else
- template <
- typename V,
- V eps = Tolerance<V>::def_epsilon>
-#endif
- struct BellmanFordToleranceOperationTraits {
- /// \brief Value type for the algorithm.
- typedef V Value;
- /// \brief Gives back the zero value of the type.
- static Value zero() {
- return static_cast<Value>(0);
- }
- /// \brief Gives back the positive infinity value of the type.
- static Value infinity() {
- return std::numeric_limits<Value>::infinity();
- }
- /// \brief Gives back the sum of the given two elements.
- static Value plus(const Value& left, const Value& right) {
- return left + right;
- }
- /// \brief Gives back \c true only if the first value is less than
- /// the second.
- static bool less(const Value& left, const Value& right) {
- return left + eps < right;
- }
- };
-
/// \brief Default traits class of BellmanFord class.
///
/// Default traits class of BellmanFord class.
@@ -155,8 +107,7 @@
///
/// It defines the used operations and the infinity value for the
/// given \c Value type.
- /// \see BellmanFordDefaultOperationTraits,
- /// BellmanFordToleranceOperationTraits
+ /// \see BellmanFordDefaultOperationTraits
typedef BellmanFordDefaultOperationTraits<Value> OperationTraits;
/// \brief The type of the map that stores the last arcs of the
@@ -886,8 +837,7 @@
///
/// It defines the used operations and the infinity value for the
/// given \c Value type.
- /// \see BellmanFordDefaultOperationTraits,
- /// BellmanFordToleranceOperationTraits
+ /// \see BellmanFordDefaultOperationTraits
typedef BellmanFordDefaultOperationTraits<Value> OperationTraits;
/// \brief The type of the map that stores the last
diff --git a/test/bellman_ford_test.cc b/test/bellman_ford_test.cc
--- a/test/bellman_ford_test.cc
+++ b/test/bellman_ford_test.cc
@@ -104,7 +104,6 @@
BF::SetPredMap<concepts::ReadWriteMap<Node,Arc> >
::SetDistMap<concepts::ReadWriteMap<Node,Value> >
::SetOperationTraits<BellmanFordDefaultOperationTraits<Value> >
- ::SetOperationTraits<BellmanFordToleranceOperationTraits<Value, 0> >
::Create bf_test(gr,length);
LengthMap length_map;
More information about the Lemon-commits
mailing list