COIN-OR::LEMON - Graph Library

Changeset 606:c5fd2d996909 in lemon for lemon/adaptors.h


Ignore:
Timestamp:
03/29/09 23:08:20 (10 years ago)
Author:
Peter Kovacs <kpeter@…>
Branch:
default
Phase:
public
Message:

Various doc improvements (#248)

  • Rename all the ugly template parameters (too long and/or starting with an underscore).
  • Rename function parameters starting with an underscore.
  • Extend the doc for many classes.
  • Use LaTeX-style O(...) expressions only for the complicated ones.
  • A lot of small unification changes.
  • Small fixes.
  • Some other improvements.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/adaptors.h

    r566 r606  
    22552255    /// This map adaptor class adapts two arc maps of the underlying
    22562256    /// 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>
     2257    /// Its value type is inherited from the first arc map type (\c FW).
     2258    /// \tparam FW The type of the "foward" arc map.
     2259    /// \tparam BK The type of the "backward" arc map.
     2260    template <typename FW, typename BK>
    22602261    class CombinedArcMap {
    22612262    public:
     
    22642265      typedef typename Parent::Arc Key;
    22652266      /// 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;
     2267      typedef typename FW::Value Value;
     2268
     2269      typedef typename MapTraits<FW>::ReferenceMapTag ReferenceMapTag;
     2270
     2271      typedef typename MapTraits<FW>::ReturnValue ReturnValue;
     2272      typedef typename MapTraits<FW>::ConstReturnValue ConstReturnValue;
     2273      typedef typename MapTraits<FW>::ReturnValue Reference;
     2274      typedef typename MapTraits<FW>::ConstReturnValue ConstReference;
    22742275
    22752276      /// Constructor
    2276       CombinedArcMap(ForwardMap& forward, BackwardMap& backward)
     2277      CombinedArcMap(FW& forward, BK& backward)
    22772278        : _forward(&forward), _backward(&backward) {}
    22782279
     
    23062307    protected:
    23072308
    2308       ForwardMap* _forward;
    2309       BackwardMap* _backward;
     2309      FW* _forward;
     2310      BK* _backward;
    23102311
    23112312    };
     
    23142315    ///
    23152316    /// 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);
     2317    template <typename FW, typename BK>
     2318    static CombinedArcMap<FW, BK>
     2319    combinedArcMap(FW& forward, BK& backward) {
     2320      return CombinedArcMap<FW, BK>(forward, backward);
     2321    }
     2322
     2323    template <typename FW, typename BK>
     2324    static CombinedArcMap<const FW, BK>
     2325    combinedArcMap(const FW& forward, BK& backward) {
     2326      return CombinedArcMap<const FW, BK>(forward, backward);
     2327    }
     2328
     2329    template <typename FW, typename BK>
     2330    static CombinedArcMap<FW, const BK>
     2331    combinedArcMap(FW& forward, const BK& backward) {
     2332      return CombinedArcMap<FW, const BK>(forward, backward);
     2333    }
     2334
     2335    template <typename FW, typename BK>
     2336    static CombinedArcMap<const FW, const BK>
     2337    combinedArcMap(const FW& forward, const BK& backward) {
     2338      return CombinedArcMap<const FW, const BK>(forward, backward);
    23412339    }
    23422340
     
    34073405    /// This map adaptor class adapts two node maps of the original digraph
    34083406    /// 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>
     3407    /// Its value type is inherited from the first node map type (\c IN).
     3408    /// \tparam IN The type of the node map for the in-nodes.
     3409    /// \tparam OUT The type of the node map for the out-nodes.
     3410    template <typename IN, typename OUT>
    34123411    class CombinedNodeMap {
    34133412    public:
     
    34163415      typedef Node Key;
    34173416      /// 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;
     3417      typedef typename IN::Value Value;
     3418
     3419      typedef typename MapTraits<IN>::ReferenceMapTag ReferenceMapTag;
     3420      typedef typename MapTraits<IN>::ReturnValue ReturnValue;
     3421      typedef typename MapTraits<IN>::ConstReturnValue ConstReturnValue;
     3422      typedef typename MapTraits<IN>::ReturnValue Reference;
     3423      typedef typename MapTraits<IN>::ConstReturnValue ConstReference;
    34253424
    34263425      /// Constructor
    3427       CombinedNodeMap(InNodeMap& in_map, OutNodeMap& out_map)
     3426      CombinedNodeMap(IN& in_map, OUT& out_map)
    34283427        : _in_map(in_map), _out_map(out_map) {}
    34293428
     
    34573456    private:
    34583457
    3459       InNodeMap& _in_map;
    3460       OutNodeMap& _out_map;
     3458      IN& _in_map;
     3459      OUT& _out_map;
    34613460
    34623461    };
     
    34663465    ///
    34673466    /// 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);
     3467    template <typename IN, typename OUT>
     3468    static CombinedNodeMap<IN, OUT>
     3469    combinedNodeMap(IN& in_map, OUT& out_map) {
     3470      return CombinedNodeMap<IN, OUT>(in_map, out_map);
     3471    }
     3472
     3473    template <typename IN, typename OUT>
     3474    static CombinedNodeMap<const IN, OUT>
     3475    combinedNodeMap(const IN& in_map, OUT& out_map) {
     3476      return CombinedNodeMap<const IN, OUT>(in_map, out_map);
     3477    }
     3478
     3479    template <typename IN, typename OUT>
     3480    static CombinedNodeMap<IN, const OUT>
     3481    combinedNodeMap(IN& in_map, const OUT& out_map) {
     3482      return CombinedNodeMap<IN, const OUT>(in_map, out_map);
     3483    }
     3484
     3485    template <typename IN, typename OUT>
     3486    static CombinedNodeMap<const IN, const OUT>
     3487    combinedNodeMap(const IN& in_map, const OUT& out_map) {
     3488      return CombinedNodeMap<const IN, const OUT>(in_map, out_map);
    34913489    }
    34923490
     
    34963494    /// This map adaptor class adapts an arc map and a node map of the
    34973495    /// 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>
     3496    /// Its value type is inherited from the original arc map type (\c AM).
     3497    /// \tparam AM The type of the arc map.
     3498    /// \tparam NM the type of the node map.
     3499    template <typename AM, typename NM>
    35013500    class CombinedArcMap {
    35023501    public:
     
    35053504      typedef Arc Key;
    35063505      /// 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;
     3506      typedef typename AM::Value Value;
     3507
     3508      typedef typename MapTraits<AM>::ReferenceMapTag ReferenceMapTag;
     3509      typedef typename MapTraits<AM>::ReturnValue ReturnValue;
     3510      typedef typename MapTraits<AM>::ConstReturnValue ConstReturnValue;
     3511      typedef typename MapTraits<AM>::ReturnValue Reference;
     3512      typedef typename MapTraits<AM>::ConstReturnValue ConstReference;
    35143513
    35153514      /// Constructor
    3516       CombinedArcMap(ArcMap& arc_map, NodeMap& node_map)
     3515      CombinedArcMap(AM& arc_map, NM& node_map)
    35173516        : _arc_map(arc_map), _node_map(node_map) {}
    35183517
     
    35453544
    35463545    private:
    3547       ArcMap& _arc_map;
    3548       NodeMap& _node_map;
     3546
     3547      AM& _arc_map;
     3548      NM& _node_map;
     3549
    35493550    };
    35503551
Note: See TracChangeset for help on using the changeset viewer.