# Changeset 960:b89e46862dc2 in lemon for lemon

Ignore:
Timestamp:
03/18/10 14:17:03 (10 years ago)
Branch:
default
Parents:
959:38213abd2911 (diff), 958:d6052a9c4e8d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Phase:
public
Message:

Merge backout of a6eb9698c321 (#360,#51)

Files:
2 edited

Unmodified
Removed

• ## lemon/bellman_ford.h

 r956 #include #include #include #include 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 /// 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::has_infinity> struct BellmanFordDefaultOperationTraits { /// \brief Value type for the algorithm. /// \e typedef V Value; /// \brief Gives back the zero value of the type. static bool less(const Value& left, const Value& right) { return left < right; } }; /// \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". /// /// \see BellmanFordDefaultOperationTraits #ifdef DOXYGEN template #else template < typename V, V eps = Tolerance::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(0); } /// \brief Gives back the positive infinity value of the type. static Value infinity() { return std::numeric_limits::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; } }; /// It defines the used operations and the infinity value for the /// given \c Value type. /// \see BellmanFordDefaultOperationTraits, /// BellmanFordToleranceOperationTraits /// \see BellmanFordDefaultOperationTraits typedef BellmanFordDefaultOperationTraits OperationTraits; /// It defines the used operations and the infinity value for the /// given \c Value type. /// \see BellmanFordDefaultOperationTraits, /// BellmanFordToleranceOperationTraits /// \see BellmanFordDefaultOperationTraits typedef BellmanFordDefaultOperationTraits OperationTraits;
Note: See TracChangeset for help on using the changeset viewer.