Changes in lemon/adaptors.h [519:c786cd201266:579:d11bf7998905] in lemon-1.2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/adaptors.h
r519 r579 2193 2193 typedef typename ItemSetTraits<DGR, Edge>::ItemNotifier EdgeNotifier; 2194 2194 EdgeNotifier& notifier(Edge) const { return _digraph->notifier(Edge()); } 2195 2196 typedef EdgeNotifier ArcNotifier; 2197 ArcNotifier& notifier(Arc) const { return _digraph->notifier(Edge()); } 2195 2198 2196 2199 protected: … … 2255 2258 /// This map adaptor class adapts two arc maps of the underlying 2256 2259 /// digraph to get an arc map of the undirected graph. 2257 /// Its value type is inherited from the first arc map type 2258 /// (\c %ForwardMap). 2259 template <typename ForwardMap, typename BackwardMap> 2260 /// Its value type is inherited from the first arc map type (\c FW). 2261 /// \tparam FW The type of the "foward" arc map. 2262 /// \tparam BK The type of the "backward" arc map. 2263 template <typename FW, typename BK> 2260 2264 class CombinedArcMap { 2261 2265 public: … … 2264 2268 typedef typename Parent::Arc Key; 2265 2269 /// The value type of the map 2266 typedef typename F orwardMap::Value Value;2267 2268 typedef typename MapTraits<F orwardMap>::ReferenceMapTag ReferenceMapTag;2269 2270 typedef typename MapTraits<F orwardMap>::ReturnValue ReturnValue;2271 typedef typename MapTraits<F orwardMap>::ConstReturnValue ConstReturnValue;2272 typedef typename MapTraits<F orwardMap>::ReturnValue Reference;2273 typedef typename MapTraits<F orwardMap>::ConstReturnValue ConstReference;2270 typedef typename FW::Value Value; 2271 2272 typedef typename MapTraits<FW>::ReferenceMapTag ReferenceMapTag; 2273 2274 typedef typename MapTraits<FW>::ReturnValue ReturnValue; 2275 typedef typename MapTraits<FW>::ConstReturnValue ConstReturnValue; 2276 typedef typename MapTraits<FW>::ReturnValue Reference; 2277 typedef typename MapTraits<FW>::ConstReturnValue ConstReference; 2274 2278 2275 2279 /// Constructor 2276 CombinedArcMap(F orwardMap& forward, BackwardMap& backward)2280 CombinedArcMap(FW& forward, BK& backward) 2277 2281 : _forward(&forward), _backward(&backward) {} 2278 2282 … … 2306 2310 protected: 2307 2311 2308 F orwardMap* _forward;2309 B ackwardMap* _backward;2312 FW* _forward; 2313 BK* _backward; 2310 2314 2311 2315 }; … … 2314 2318 /// 2315 2319 /// This function just returns a combined arc map. 2316 template <typename ForwardMap, typename BackwardMap> 2317 static CombinedArcMap<ForwardMap, BackwardMap> 2318 combinedArcMap(ForwardMap& forward, BackwardMap& backward) { 2319 return CombinedArcMap<ForwardMap, BackwardMap>(forward, backward); 2320 } 2321 2322 template <typename ForwardMap, typename BackwardMap> 2323 static CombinedArcMap<const ForwardMap, BackwardMap> 2324 combinedArcMap(const ForwardMap& forward, BackwardMap& backward) { 2325 return CombinedArcMap<const ForwardMap, 2326 BackwardMap>(forward, backward); 2327 } 2328 2329 template <typename ForwardMap, typename BackwardMap> 2330 static CombinedArcMap<ForwardMap, const BackwardMap> 2331 combinedArcMap(ForwardMap& forward, const BackwardMap& backward) { 2332 return CombinedArcMap<ForwardMap, 2333 const BackwardMap>(forward, backward); 2334 } 2335 2336 template <typename ForwardMap, typename BackwardMap> 2337 static CombinedArcMap<const ForwardMap, const BackwardMap> 2338 combinedArcMap(const ForwardMap& forward, const BackwardMap& backward) { 2339 return CombinedArcMap<const ForwardMap, 2340 const BackwardMap>(forward, backward); 2320 template <typename FW, typename BK> 2321 static CombinedArcMap<FW, BK> 2322 combinedArcMap(FW& forward, BK& backward) { 2323 return CombinedArcMap<FW, BK>(forward, backward); 2324 } 2325 2326 template <typename FW, typename BK> 2327 static CombinedArcMap<const FW, BK> 2328 combinedArcMap(const FW& forward, BK& backward) { 2329 return CombinedArcMap<const FW, BK>(forward, backward); 2330 } 2331 2332 template <typename FW, typename BK> 2333 static CombinedArcMap<FW, const BK> 2334 combinedArcMap(FW& forward, const BK& backward) { 2335 return CombinedArcMap<FW, const BK>(forward, backward); 2336 } 2337 2338 template <typename FW, typename BK> 2339 static CombinedArcMap<const FW, const BK> 2340 combinedArcMap(const FW& forward, const BK& backward) { 2341 return CombinedArcMap<const FW, const BK>(forward, backward); 2341 2342 } 2342 2343 … … 3407 3408 /// This map adaptor class adapts two node maps of the original digraph 3408 3409 /// to get a node map of the split digraph. 3409 /// Its value type is inherited from the first node map type 3410 /// (\c InNodeMap). 3411 template <typename InNodeMap, typename OutNodeMap> 3410 /// Its value type is inherited from the first node map type (\c IN). 3411 /// \tparam IN The type of the node map for the in-nodes. 3412 /// \tparam OUT The type of the node map for the out-nodes. 3413 template <typename IN, typename OUT> 3412 3414 class CombinedNodeMap { 3413 3415 public: … … 3416 3418 typedef Node Key; 3417 3419 /// The value type of the map 3418 typedef typename I nNodeMap::Value Value;3419 3420 typedef typename MapTraits<I nNodeMap>::ReferenceMapTag ReferenceMapTag;3421 typedef typename MapTraits<I nNodeMap>::ReturnValue ReturnValue;3422 typedef typename MapTraits<I nNodeMap>::ConstReturnValue ConstReturnValue;3423 typedef typename MapTraits<I nNodeMap>::ReturnValue Reference;3424 typedef typename MapTraits<I nNodeMap>::ConstReturnValue ConstReference;3420 typedef typename IN::Value Value; 3421 3422 typedef typename MapTraits<IN>::ReferenceMapTag ReferenceMapTag; 3423 typedef typename MapTraits<IN>::ReturnValue ReturnValue; 3424 typedef typename MapTraits<IN>::ConstReturnValue ConstReturnValue; 3425 typedef typename MapTraits<IN>::ReturnValue Reference; 3426 typedef typename MapTraits<IN>::ConstReturnValue ConstReference; 3425 3427 3426 3428 /// Constructor 3427 CombinedNodeMap(I nNodeMap& in_map, OutNodeMap& out_map)3429 CombinedNodeMap(IN& in_map, OUT& out_map) 3428 3430 : _in_map(in_map), _out_map(out_map) {} 3429 3431 … … 3457 3459 private: 3458 3460 3459 I nNodeMap& _in_map;3460 O utNodeMap& _out_map;3461 IN& _in_map; 3462 OUT& _out_map; 3461 3463 3462 3464 }; … … 3466 3468 /// 3467 3469 /// This function just returns a combined node map. 3468 template <typename InNodeMap, typename OutNodeMap> 3469 static CombinedNodeMap<InNodeMap, OutNodeMap> 3470 combinedNodeMap(InNodeMap& in_map, OutNodeMap& out_map) { 3471 return CombinedNodeMap<InNodeMap, OutNodeMap>(in_map, out_map); 3472 } 3473 3474 template <typename InNodeMap, typename OutNodeMap> 3475 static CombinedNodeMap<const InNodeMap, OutNodeMap> 3476 combinedNodeMap(const InNodeMap& in_map, OutNodeMap& out_map) { 3477 return CombinedNodeMap<const InNodeMap, OutNodeMap>(in_map, out_map); 3478 } 3479 3480 template <typename InNodeMap, typename OutNodeMap> 3481 static CombinedNodeMap<InNodeMap, const OutNodeMap> 3482 combinedNodeMap(InNodeMap& in_map, const OutNodeMap& out_map) { 3483 return CombinedNodeMap<InNodeMap, const OutNodeMap>(in_map, out_map); 3484 } 3485 3486 template <typename InNodeMap, typename OutNodeMap> 3487 static CombinedNodeMap<const InNodeMap, const OutNodeMap> 3488 combinedNodeMap(const InNodeMap& in_map, const OutNodeMap& out_map) { 3489 return CombinedNodeMap<const InNodeMap, 3490 const OutNodeMap>(in_map, out_map); 3470 template <typename IN, typename OUT> 3471 static CombinedNodeMap<IN, OUT> 3472 combinedNodeMap(IN& in_map, OUT& out_map) { 3473 return CombinedNodeMap<IN, OUT>(in_map, out_map); 3474 } 3475 3476 template <typename IN, typename OUT> 3477 static CombinedNodeMap<const IN, OUT> 3478 combinedNodeMap(const IN& in_map, OUT& out_map) { 3479 return CombinedNodeMap<const IN, OUT>(in_map, out_map); 3480 } 3481 3482 template <typename IN, typename OUT> 3483 static CombinedNodeMap<IN, const OUT> 3484 combinedNodeMap(IN& in_map, const OUT& out_map) { 3485 return CombinedNodeMap<IN, const OUT>(in_map, out_map); 3486 } 3487 3488 template <typename IN, typename OUT> 3489 static CombinedNodeMap<const IN, const OUT> 3490 combinedNodeMap(const IN& in_map, const OUT& out_map) { 3491 return CombinedNodeMap<const IN, const OUT>(in_map, out_map); 3491 3492 } 3492 3493 … … 3496 3497 /// This map adaptor class adapts an arc map and a node map of the 3497 3498 /// original digraph to get an arc map of the split digraph. 3498 /// Its value type is inherited from the original arc map type 3499 /// (\c ArcMap). 3500 template <typename ArcMap, typename NodeMap> 3499 /// Its value type is inherited from the original arc map type (\c AM). 3500 /// \tparam AM The type of the arc map. 3501 /// \tparam NM the type of the node map. 3502 template <typename AM, typename NM> 3501 3503 class CombinedArcMap { 3502 3504 public: … … 3505 3507 typedef Arc Key; 3506 3508 /// The value type of the map 3507 typedef typename A rcMap::Value Value;3508 3509 typedef typename MapTraits<A rcMap>::ReferenceMapTag ReferenceMapTag;3510 typedef typename MapTraits<A rcMap>::ReturnValue ReturnValue;3511 typedef typename MapTraits<A rcMap>::ConstReturnValue ConstReturnValue;3512 typedef typename MapTraits<A rcMap>::ReturnValue Reference;3513 typedef typename MapTraits<A rcMap>::ConstReturnValue ConstReference;3509 typedef typename AM::Value Value; 3510 3511 typedef typename MapTraits<AM>::ReferenceMapTag ReferenceMapTag; 3512 typedef typename MapTraits<AM>::ReturnValue ReturnValue; 3513 typedef typename MapTraits<AM>::ConstReturnValue ConstReturnValue; 3514 typedef typename MapTraits<AM>::ReturnValue Reference; 3515 typedef typename MapTraits<AM>::ConstReturnValue ConstReference; 3514 3516 3515 3517 /// Constructor 3516 CombinedArcMap(A rcMap& arc_map, NodeMap& node_map)3518 CombinedArcMap(AM& arc_map, NM& node_map) 3517 3519 : _arc_map(arc_map), _node_map(node_map) {} 3518 3520 … … 3545 3547 3546 3548 private: 3547 ArcMap& _arc_map; 3548 NodeMap& _node_map; 3549 3550 AM& _arc_map; 3551 NM& _node_map; 3552 3549 3553 }; 3550 3554
Note: See TracChangeset
for help on using the changeset viewer.