COIN-OR::LEMON - Graph Library

Ticket #187: 62f9787c516c.patch

File 62f9787c516c.patch, 2.1 KB (added by Peter Kovacs, 16 years ago)
  • lemon/dijkstra.h

    # HG changeset patch
    # User Peter Kovacs <kpeter@inf.elte.hu>
    # Date 1228138422 -3600
    # Node ID 62f9787c516c468a3676bb7a91731da83aa64543
    # Parent  c4aa9f097ef103efaace0da886a07331ba7c8ddf
    Remove DijkstraWidestPathOperationTraits (#187)
    
    diff --git a/lemon/dijkstra.h b/lemon/dijkstra.h
    a b  
    4747    /// \brief Gives back the sum of the given two elements.
    4848    static Value plus(const Value& left, const Value& right) {
    4949      return left + right;
    50     }
    51     /// \brief Gives back true only if the first value is less than the second.
    52     static bool less(const Value& left, const Value& right) {
    53       return left < right;
    54     }
    55   };
    56 
    57   /// \brief Widest path operation traits for the Dijkstra algorithm class.
    58   ///
    59   /// This operation traits class defines all computational operations and
    60   /// constants which are used in the Dijkstra algorithm for widest path
    61   /// computation.
    62   ///
    63   /// \see DijkstraDefaultOperationTraits
    64   template <typename Value>
    65   struct DijkstraWidestPathOperationTraits {
    66     /// \brief Gives back the maximum value of the type.
    67     static Value zero() {
    68       return std::numeric_limits<Value>::max();
    69     }
    70     /// \brief Gives back the minimum of the given two elements.
    71     static Value plus(const Value& left, const Value& right) {
    72       return std::min(left, right);
    7350    }
    7451    /// \brief Gives back true only if the first value is less than the second.
    7552    static bool less(const Value& left, const Value& right) {
  • test/dijkstra_test.cc

    diff --git a/test/dijkstra_test.cc b/test/dijkstra_test.cc
    a b  
    8989      ::SetDistMap<concepts::ReadWriteMap<Node,VType> >
    9090      ::SetProcessedMap<concepts::WriteMap<Node,bool> >
    9191      ::SetStandardProcessedMap
    92       ::SetOperationTraits<DijkstraWidestPathOperationTraits<VType> >
     92      ::SetOperationTraits<DijkstraDefaultOperationTraits<VType> >
    9393      ::SetHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> > >
    9494      ::SetStandardHeap<BinHeap<VType, concepts::ReadWriteMap<Node,int> > >
    9595      ::Create dijkstra_test(G,length);