diff -r 94387da47f79 -r c5fd2d996909 lemon/adaptors.h --- a/lemon/adaptors.h Thu Mar 05 10:13:20 2009 +0000 +++ b/lemon/adaptors.h Sun Mar 29 23:08:20 2009 +0200 @@ -2254,26 +2254,27 @@ /// /// This map adaptor class adapts two arc maps of the underlying /// digraph to get an arc map of the undirected graph. - /// Its value type is inherited from the first arc map type - /// (\c %ForwardMap). - template + /// Its value type is inherited from the first arc map type (\c FW). + /// \tparam FW The type of the "foward" arc map. + /// \tparam BK The type of the "backward" arc map. + template class CombinedArcMap { public: /// The key type of the map typedef typename Parent::Arc Key; /// The value type of the map - typedef typename ForwardMap::Value Value; - - typedef typename MapTraits::ReferenceMapTag ReferenceMapTag; - - typedef typename MapTraits::ReturnValue ReturnValue; - typedef typename MapTraits::ConstReturnValue ConstReturnValue; - typedef typename MapTraits::ReturnValue Reference; - typedef typename MapTraits::ConstReturnValue ConstReference; + typedef typename FW::Value Value; + + typedef typename MapTraits::ReferenceMapTag ReferenceMapTag; + + typedef typename MapTraits::ReturnValue ReturnValue; + typedef typename MapTraits::ConstReturnValue ConstReturnValue; + typedef typename MapTraits::ReturnValue Reference; + typedef typename MapTraits::ConstReturnValue ConstReference; /// Constructor - CombinedArcMap(ForwardMap& forward, BackwardMap& backward) + CombinedArcMap(FW& forward, BK& backward) : _forward(&forward), _backward(&backward) {} /// Sets the value associated with the given key. @@ -2305,39 +2306,36 @@ protected: - ForwardMap* _forward; - BackwardMap* _backward; + FW* _forward; + BK* _backward; }; /// \brief Returns a combined arc map /// /// This function just returns a combined arc map. - template - static CombinedArcMap - combinedArcMap(ForwardMap& forward, BackwardMap& backward) { - return CombinedArcMap(forward, backward); + template + static CombinedArcMap + combinedArcMap(FW& forward, BK& backward) { + return CombinedArcMap(forward, backward); } - template - static CombinedArcMap - combinedArcMap(const ForwardMap& forward, BackwardMap& backward) { - return CombinedArcMap(forward, backward); + template + static CombinedArcMap + combinedArcMap(const FW& forward, BK& backward) { + return CombinedArcMap(forward, backward); } - template - static CombinedArcMap - combinedArcMap(ForwardMap& forward, const BackwardMap& backward) { - return CombinedArcMap(forward, backward); + template + static CombinedArcMap + combinedArcMap(FW& forward, const BK& backward) { + return CombinedArcMap(forward, backward); } - template - static CombinedArcMap - combinedArcMap(const ForwardMap& forward, const BackwardMap& backward) { - return CombinedArcMap(forward, backward); + template + static CombinedArcMap + combinedArcMap(const FW& forward, const BK& backward) { + return CombinedArcMap(forward, backward); } }; @@ -3406,25 +3404,26 @@ /// /// This map adaptor class adapts two node maps of the original digraph /// to get a node map of the split digraph. - /// Its value type is inherited from the first node map type - /// (\c InNodeMap). - template + /// Its value type is inherited from the first node map type (\c IN). + /// \tparam IN The type of the node map for the in-nodes. + /// \tparam OUT The type of the node map for the out-nodes. + template class CombinedNodeMap { public: /// The key type of the map typedef Node Key; /// The value type of the map - typedef typename InNodeMap::Value Value; - - typedef typename MapTraits::ReferenceMapTag ReferenceMapTag; - typedef typename MapTraits::ReturnValue ReturnValue; - typedef typename MapTraits::ConstReturnValue ConstReturnValue; - typedef typename MapTraits::ReturnValue Reference; - typedef typename MapTraits::ConstReturnValue ConstReference; + typedef typename IN::Value Value; + + typedef typename MapTraits::ReferenceMapTag ReferenceMapTag; + typedef typename MapTraits::ReturnValue ReturnValue; + typedef typename MapTraits::ConstReturnValue ConstReturnValue; + typedef typename MapTraits::ReturnValue Reference; + typedef typename MapTraits::ConstReturnValue ConstReference; /// Constructor - CombinedNodeMap(InNodeMap& in_map, OutNodeMap& out_map) + CombinedNodeMap(IN& in_map, OUT& out_map) : _in_map(in_map), _out_map(out_map) {} /// Returns the value associated with the given key. @@ -3456,8 +3455,8 @@ private: - InNodeMap& _in_map; - OutNodeMap& _out_map; + IN& _in_map; + OUT& _out_map; }; @@ -3465,29 +3464,28 @@ /// \brief Returns a combined node map /// /// This function just returns a combined node map. - template - static CombinedNodeMap - combinedNodeMap(InNodeMap& in_map, OutNodeMap& out_map) { - return CombinedNodeMap(in_map, out_map); + template + static CombinedNodeMap + combinedNodeMap(IN& in_map, OUT& out_map) { + return CombinedNodeMap(in_map, out_map); } - template - static CombinedNodeMap - combinedNodeMap(const InNodeMap& in_map, OutNodeMap& out_map) { - return CombinedNodeMap(in_map, out_map); + template + static CombinedNodeMap + combinedNodeMap(const IN& in_map, OUT& out_map) { + return CombinedNodeMap(in_map, out_map); } - template - static CombinedNodeMap - combinedNodeMap(InNodeMap& in_map, const OutNodeMap& out_map) { - return CombinedNodeMap(in_map, out_map); + template + static CombinedNodeMap + combinedNodeMap(IN& in_map, const OUT& out_map) { + return CombinedNodeMap(in_map, out_map); } - template - static CombinedNodeMap - combinedNodeMap(const InNodeMap& in_map, const OutNodeMap& out_map) { - return CombinedNodeMap(in_map, out_map); + template + static CombinedNodeMap + combinedNodeMap(const IN& in_map, const OUT& out_map) { + return CombinedNodeMap(in_map, out_map); } /// \brief Arc map combined from an arc map and a node map of the @@ -3495,25 +3493,26 @@ /// /// This map adaptor class adapts an arc map and a node map of the /// original digraph to get an arc map of the split digraph. - /// Its value type is inherited from the original arc map type - /// (\c ArcMap). - template + /// Its value type is inherited from the original arc map type (\c AM). + /// \tparam AM The type of the arc map. + /// \tparam NM the type of the node map. + template class CombinedArcMap { public: /// The key type of the map typedef Arc Key; /// The value type of the map - typedef typename ArcMap::Value Value; - - typedef typename MapTraits::ReferenceMapTag ReferenceMapTag; - typedef typename MapTraits::ReturnValue ReturnValue; - typedef typename MapTraits::ConstReturnValue ConstReturnValue; - typedef typename MapTraits::ReturnValue Reference; - typedef typename MapTraits::ConstReturnValue ConstReference; + typedef typename AM::Value Value; + + typedef typename MapTraits::ReferenceMapTag ReferenceMapTag; + typedef typename MapTraits::ReturnValue ReturnValue; + typedef typename MapTraits::ConstReturnValue ConstReturnValue; + typedef typename MapTraits::ReturnValue Reference; + typedef typename MapTraits::ConstReturnValue ConstReference; /// Constructor - CombinedArcMap(ArcMap& arc_map, NodeMap& node_map) + CombinedArcMap(AM& arc_map, NM& node_map) : _arc_map(arc_map), _node_map(node_map) {} /// Returns the value associated with the given key. @@ -3544,8 +3543,10 @@ } private: - ArcMap& _arc_map; - NodeMap& _node_map; + + AM& _arc_map; + NM& _node_map; + }; /// \brief Returns a combined arc map