lemon/concepts/digraph.h
changeset 708 994c7df296c9
parent 514 f5bc148f7e1f
child 761 f1398882a928
child 807 3e711ee55d31
     1.1 --- a/lemon/concepts/digraph.h	Fri Nov 13 12:33:33 2009 +0100
     1.2 +++ b/lemon/concepts/digraph.h	Thu Dec 10 17:05:35 2009 +0100
     1.3 @@ -2,7 +2,7 @@
     1.4   *
     1.5   * This file is a part of LEMON, a generic C++ optimization library.
     1.6   *
     1.7 - * Copyright (C) 2003-2008
     1.8 + * Copyright (C) 2003-2009
     1.9   * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    1.10   * (Egervary Research Group on Combinatorial Optimization, EGRES).
    1.11   *
    1.12 @@ -16,8 +16,8 @@
    1.13   *
    1.14   */
    1.15  
    1.16 -#ifndef LEMON_CONCEPT_DIGRAPH_H
    1.17 -#define LEMON_CONCEPT_DIGRAPH_H
    1.18 +#ifndef LEMON_CONCEPTS_DIGRAPH_H
    1.19 +#define LEMON_CONCEPTS_DIGRAPH_H
    1.20  
    1.21  ///\ingroup graph_concepts
    1.22  ///\file
    1.23 @@ -421,12 +421,11 @@
    1.24        /// Gives back the opposite node on the given arc.
    1.25        Node oppositeNode(const Node&, const Arc&) const { return INVALID; }
    1.26  
    1.27 -      /// \brief Read write map of the nodes to type \c T.
    1.28 +      /// \brief Reference map of the nodes to type \c T.
    1.29        ///
    1.30 -      /// ReadWrite map of the nodes to type \c T.
    1.31 -      /// \sa Reference
    1.32 +      /// Reference map of the nodes to type \c T.
    1.33        template<class T>
    1.34 -      class NodeMap : public ReadWriteMap< Node, T > {
    1.35 +      class NodeMap : public ReferenceMap<Node, T, T&, const T&> {
    1.36        public:
    1.37  
    1.38          ///\e
    1.39 @@ -436,7 +435,8 @@
    1.40  
    1.41        private:
    1.42          ///Copy constructor
    1.43 -        NodeMap(const NodeMap& nm) : ReadWriteMap< Node, T >(nm) { }
    1.44 +        NodeMap(const NodeMap& nm) : 
    1.45 +          ReferenceMap<Node, T, T&, const T&>(nm) { }
    1.46          ///Assignment operator
    1.47          template <typename CMap>
    1.48          NodeMap& operator=(const CMap&) {
    1.49 @@ -445,12 +445,11 @@
    1.50          }
    1.51        };
    1.52  
    1.53 -      /// \brief Read write map of the arcs to type \c T.
    1.54 +      /// \brief Reference map of the arcs to type \c T.
    1.55        ///
    1.56        /// Reference map of the arcs to type \c T.
    1.57 -      /// \sa Reference
    1.58        template<class T>
    1.59 -      class ArcMap : public ReadWriteMap<Arc,T> {
    1.60 +      class ArcMap : public ReferenceMap<Arc, T, T&, const T&> {
    1.61        public:
    1.62  
    1.63          ///\e
    1.64 @@ -459,7 +458,8 @@
    1.65          ArcMap(const Digraph&, T) { }
    1.66        private:
    1.67          ///Copy constructor
    1.68 -        ArcMap(const ArcMap& em) : ReadWriteMap<Arc,T>(em) { }
    1.69 +        ArcMap(const ArcMap& em) :
    1.70 +          ReferenceMap<Arc, T, T&, const T&>(em) { }
    1.71          ///Assignment operator
    1.72          template <typename CMap>
    1.73          ArcMap& operator=(const CMap&) {
    1.74 @@ -471,6 +471,7 @@
    1.75        template <typename _Digraph>
    1.76        struct Constraints {
    1.77          void constraints() {
    1.78 +          checkConcept<BaseDigraphComponent, _Digraph>();
    1.79            checkConcept<IterableDigraphComponent<>, _Digraph>();
    1.80            checkConcept<IDableDigraphComponent<>, _Digraph>();
    1.81            checkConcept<MappableDigraphComponent<>, _Digraph>();
    1.82 @@ -484,4 +485,4 @@
    1.83  
    1.84  
    1.85  
    1.86 -#endif // LEMON_CONCEPT_DIGRAPH_H
    1.87 +#endif