COIN-OR::LEMON - Graph Library

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/adaptors.h

    r566 r626  
    21932193    typedef typename ItemSetTraits<DGR, Edge>::ItemNotifier EdgeNotifier;
    21942194    EdgeNotifier& notifier(Edge) const { return _digraph->notifier(Edge()); }
     2195   
     2196    typedef EdgeNotifier ArcNotifier;
     2197    ArcNotifier& notifier(Arc) const { return _digraph->notifier(Edge()); }
    21952198
    21962199  protected:
     
    22552258    /// This map adaptor class adapts two arc maps of the underlying
    22562259    /// 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>
    22602264    class CombinedArcMap {
    22612265    public:
     
    22642268      typedef typename Parent::Arc Key;
    22652269      /// The value type of the map
    2266       typedef typename ForwardMap::Value Value;
    2267 
    2268       typedef typename MapTraits<ForwardMap>::ReferenceMapTag ReferenceMapTag;
    2269 
    2270       typedef typename MapTraits<ForwardMap>::ReturnValue ReturnValue;
    2271       typedef typename MapTraits<ForwardMap>::ConstReturnValue ConstReturnValue;
    2272       typedef typename MapTraits<ForwardMap>::ReturnValue Reference;
    2273       typedef typename MapTraits<ForwardMap>::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;
    22742278
    22752279      /// Constructor
    2276       CombinedArcMap(ForwardMap& forward, BackwardMap& backward)
     2280      CombinedArcMap(FW& forward, BK& backward)
    22772281        : _forward(&forward), _backward(&backward) {}
    22782282
     
    23062310    protected:
    23072311
    2308       ForwardMap* _forward;
    2309       BackwardMap* _backward;
     2312      FW* _forward;
     2313      BK* _backward;
    23102314
    23112315    };
     
    23142318    ///
    23152319    /// 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);
    23412342    }
    23422343
     
    34073408    /// This map adaptor class adapts two node maps of the original digraph
    34083409    /// 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>
    34123414    class CombinedNodeMap {
    34133415    public:
     
    34163418      typedef Node Key;
    34173419      /// The value type of the map
    3418       typedef typename InNodeMap::Value Value;
    3419 
    3420       typedef typename MapTraits<InNodeMap>::ReferenceMapTag ReferenceMapTag;
    3421       typedef typename MapTraits<InNodeMap>::ReturnValue ReturnValue;
    3422       typedef typename MapTraits<InNodeMap>::ConstReturnValue ConstReturnValue;
    3423       typedef typename MapTraits<InNodeMap>::ReturnValue Reference;
    3424       typedef typename MapTraits<InNodeMap>::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;
    34253427
    34263428      /// Constructor
    3427       CombinedNodeMap(InNodeMap& in_map, OutNodeMap& out_map)
     3429      CombinedNodeMap(IN& in_map, OUT& out_map)
    34283430        : _in_map(in_map), _out_map(out_map) {}
    34293431
     
    34573459    private:
    34583460
    3459       InNodeMap& _in_map;
    3460       OutNodeMap& _out_map;
     3461      IN& _in_map;
     3462      OUT& _out_map;
    34613463
    34623464    };
     
    34663468    ///
    34673469    /// 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);
    34913492    }
    34923493
     
    34963497    /// This map adaptor class adapts an arc map and a node map of the
    34973498    /// 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>
    35013503    class CombinedArcMap {
    35023504    public:
     
    35053507      typedef Arc Key;
    35063508      /// The value type of the map
    3507       typedef typename ArcMap::Value Value;
    3508 
    3509       typedef typename MapTraits<ArcMap>::ReferenceMapTag ReferenceMapTag;
    3510       typedef typename MapTraits<ArcMap>::ReturnValue ReturnValue;
    3511       typedef typename MapTraits<ArcMap>::ConstReturnValue ConstReturnValue;
    3512       typedef typename MapTraits<ArcMap>::ReturnValue Reference;
    3513       typedef typename MapTraits<ArcMap>::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;
    35143516
    35153517      /// Constructor
    3516       CombinedArcMap(ArcMap& arc_map, NodeMap& node_map)
     3518      CombinedArcMap(AM& arc_map, NM& node_map)
    35173519        : _arc_map(arc_map), _node_map(node_map) {}
    35183520
     
    35453547
    35463548    private:
    3547       ArcMap& _arc_map;
    3548       NodeMap& _node_map;
     3549
     3550      AM& _arc_map;
     3551      NM& _node_map;
     3552
    35493553    };
    35503554
Note: See TracChangeset for help on using the changeset viewer.