lemon/concepts/digraph.h
changeset 209 765619b7cbb2
parent 125 19e82bda606a
child 220 a5d8c039f218
     1.1 --- a/lemon/concepts/digraph.h	Sun Jul 13 16:46:56 2008 +0100
     1.2 +++ b/lemon/concepts/digraph.h	Sun Jul 13 19:51:02 2008 +0100
     1.3 @@ -1,6 +1,6 @@
     1.4 -/* -*- C++ -*-
     1.5 +/* -*- mode: C++; indent-tabs-mode: nil; -*-
     1.6   *
     1.7 - * This file is a part of LEMON, a generic C++ optimization library
     1.8 + * This file is a part of LEMON, a generic C++ optimization library.
     1.9   *
    1.10   * Copyright (C) 2003-2008
    1.11   * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    1.12 @@ -46,13 +46,13 @@
    1.13      class Digraph {
    1.14      private:
    1.15        ///Digraphs are \e not copy constructible. Use DigraphCopy() instead.
    1.16 -      
    1.17 +
    1.18        ///Digraphs are \e not copy constructible. Use DigraphCopy() instead.
    1.19        ///
    1.20        Digraph(const Digraph &) {};
    1.21        ///\brief Assignment of \ref Digraph "Digraph"s to another ones are
    1.22        ///\e not allowed. Use DigraphCopy() instead.
    1.23 -      
    1.24 +
    1.25        ///Assignment of \ref Digraph "Digraph"s to another ones are
    1.26        ///\e not allowed.  Use DigraphCopy() instead.
    1.27  
    1.28 @@ -95,23 +95,23 @@
    1.29          bool operator==(Node) const { return true; }
    1.30  
    1.31          /// Inequality operator
    1.32 -        
    1.33 +
    1.34          /// \sa operator==(Node n)
    1.35          ///
    1.36          bool operator!=(Node) const { return true; }
    1.37  
    1.38 -	/// Artificial ordering operator.
    1.39 -	
    1.40 -	/// To allow the use of digraph descriptors as key type in std::map or
    1.41 -	/// similar associative container we require this.
    1.42 -	///
    1.43 -	/// \note This operator only have to define some strict ordering of
    1.44 -	/// the items; this order has nothing to do with the iteration
    1.45 -	/// ordering of the items.
    1.46 -	bool operator<(Node) const { return false; }
    1.47 +        /// Artificial ordering operator.
    1.48 +
    1.49 +        /// To allow the use of digraph descriptors as key type in std::map or
    1.50 +        /// similar associative container we require this.
    1.51 +        ///
    1.52 +        /// \note This operator only have to define some strict ordering of
    1.53 +        /// the items; this order has nothing to do with the iteration
    1.54 +        /// ordering of the items.
    1.55 +        bool operator<(Node) const { return false; }
    1.56  
    1.57        };
    1.58 -    
    1.59 +
    1.60        /// This iterator goes through each node.
    1.61  
    1.62        /// This iterator goes through each node.
    1.63 @@ -129,7 +129,7 @@
    1.64          /// to an undefined value.
    1.65          NodeIt() { }
    1.66          /// Copy constructor.
    1.67 -        
    1.68 +
    1.69          /// Copy constructor.
    1.70          ///
    1.71          NodeIt(const NodeIt& n) : Node(n) { }
    1.72 @@ -145,9 +145,9 @@
    1.73          NodeIt(const Digraph&) { }
    1.74          /// Node -> NodeIt conversion.
    1.75  
    1.76 -        /// Sets the iterator to the node of \c the digraph pointed by 
    1.77 -	/// the trivial iterator.
    1.78 -        /// This feature necessitates that each time we 
    1.79 +        /// Sets the iterator to the node of \c the digraph pointed by
    1.80 +        /// the trivial iterator.
    1.81 +        /// This feature necessitates that each time we
    1.82          /// iterate the arc-set, the iteration order is the same.
    1.83          NodeIt(const Digraph&, const Node&) { }
    1.84          /// Next node.
    1.85 @@ -156,8 +156,8 @@
    1.86          ///
    1.87          NodeIt& operator++() { return *this; }
    1.88        };
    1.89 -    
    1.90 -    
    1.91 +
    1.92 +
    1.93        /// Class for identifying an arc of the digraph
    1.94  
    1.95        /// This class identifies an arc of the digraph. It also serves
    1.96 @@ -191,17 +191,17 @@
    1.97          ///
    1.98          bool operator!=(Arc) const { return true; }
    1.99  
   1.100 -	/// Artificial ordering operator.
   1.101 -	
   1.102 -	/// To allow the use of digraph descriptors as key type in std::map or
   1.103 -	/// similar associative container we require this.
   1.104 -	///
   1.105 -	/// \note This operator only have to define some strict ordering of
   1.106 -	/// the items; this order has nothing to do with the iteration
   1.107 -	/// ordering of the items.
   1.108 -	bool operator<(Arc) const { return false; }
   1.109 +        /// Artificial ordering operator.
   1.110 +
   1.111 +        /// To allow the use of digraph descriptors as key type in std::map or
   1.112 +        /// similar associative container we require this.
   1.113 +        ///
   1.114 +        /// \note This operator only have to define some strict ordering of
   1.115 +        /// the items; this order has nothing to do with the iteration
   1.116 +        /// ordering of the items.
   1.117 +        bool operator<(Arc) const { return false; }
   1.118        };
   1.119 -    
   1.120 +
   1.121        /// This iterator goes trough the outgoing arcs of a node.
   1.122  
   1.123        /// This iterator goes trough the \e outgoing arcs of a certain node
   1.124 @@ -213,7 +213,7 @@
   1.125        /// int count=0;
   1.126        /// for (Digraph::OutArcIt e(g, n); e!=INVALID; ++e) ++count;
   1.127        ///\endcode
   1.128 -    
   1.129 +
   1.130        class OutArcIt : public Arc {
   1.131        public:
   1.132          /// Default constructor
   1.133 @@ -232,19 +232,19 @@
   1.134          ///
   1.135          OutArcIt(Invalid) { }
   1.136          /// This constructor sets the iterator to the first outgoing arc.
   1.137 -    
   1.138 +
   1.139          /// This constructor sets the iterator to the first outgoing arc of
   1.140          /// the node.
   1.141          OutArcIt(const Digraph&, const Node&) { }
   1.142          /// Arc -> OutArcIt conversion
   1.143  
   1.144          /// Sets the iterator to the value of the trivial iterator.
   1.145 -	/// This feature necessitates that each time we 
   1.146 +        /// This feature necessitates that each time we
   1.147          /// iterate the arc-set, the iteration order is the same.
   1.148          OutArcIt(const Digraph&, const Arc&) { }
   1.149          ///Next outgoing arc
   1.150 -        
   1.151 -        /// Assign the iterator to the next 
   1.152 +
   1.153 +        /// Assign the iterator to the next
   1.154          /// outgoing arc of the corresponding node.
   1.155          OutArcIt& operator++() { return *this; }
   1.156        };
   1.157 @@ -279,14 +279,14 @@
   1.158          ///
   1.159          InArcIt(Invalid) { }
   1.160          /// This constructor sets the iterator to first incoming arc.
   1.161 -    
   1.162 +
   1.163          /// This constructor set the iterator to the first incoming arc of
   1.164          /// the node.
   1.165          InArcIt(const Digraph&, const Node&) { }
   1.166          /// Arc -> InArcIt conversion
   1.167  
   1.168          /// Sets the iterator to the value of the trivial iterator \c e.
   1.169 -        /// This feature necessitates that each time we 
   1.170 +        /// This feature necessitates that each time we
   1.171          /// iterate the arc-set, the iteration order is the same.
   1.172          InArcIt(const Digraph&, const Arc&) { }
   1.173          /// Next incoming arc
   1.174 @@ -322,18 +322,18 @@
   1.175          ///
   1.176          ArcIt(Invalid) { }
   1.177          /// This constructor sets the iterator to the first arc.
   1.178 -    
   1.179 +
   1.180          /// This constructor sets the iterator to the first arc of \c g.
   1.181          ///@param g the digraph
   1.182          ArcIt(const Digraph& g) { ignore_unused_variable_warning(g); }
   1.183          /// Arc -> ArcIt conversion
   1.184  
   1.185          /// Sets the iterator to the value of the trivial iterator \c e.
   1.186 -        /// This feature necessitates that each time we 
   1.187 +        /// This feature necessitates that each time we
   1.188          /// iterate the arc-set, the iteration order is the same.
   1.189 -        ArcIt(const Digraph&, const Arc&) { } 
   1.190 +        ArcIt(const Digraph&, const Arc&) { }
   1.191          ///Next arc
   1.192 -        
   1.193 +
   1.194          /// Assign the iterator to the next arc.
   1.195          ArcIt& operator++() { return *this; }
   1.196        };
   1.197 @@ -349,26 +349,26 @@
   1.198        Node source(Arc) const { return INVALID; }
   1.199  
   1.200        /// \brief Returns the ID of the node.
   1.201 -      int id(Node) const { return -1; } 
   1.202 +      int id(Node) const { return -1; }
   1.203  
   1.204        /// \brief Returns the ID of the arc.
   1.205 -      int id(Arc) const { return -1; } 
   1.206 +      int id(Arc) const { return -1; }
   1.207  
   1.208        /// \brief Returns the node with the given ID.
   1.209        ///
   1.210        /// \pre The argument should be a valid node ID in the graph.
   1.211 -      Node nodeFromId(int) const { return INVALID; } 
   1.212 +      Node nodeFromId(int) const { return INVALID; }
   1.213  
   1.214        /// \brief Returns the arc with the given ID.
   1.215        ///
   1.216        /// \pre The argument should be a valid arc ID in the graph.
   1.217 -      Arc arcFromId(int) const { return INVALID; } 
   1.218 +      Arc arcFromId(int) const { return INVALID; }
   1.219  
   1.220        /// \brief Returns an upper bound on the node IDs.
   1.221 -      int maxNodeId() const { return -1; } 
   1.222 +      int maxNodeId() const { return -1; }
   1.223  
   1.224        /// \brief Returns an upper bound on the arc IDs.
   1.225 -      int maxArcId() const { return -1; } 
   1.226 +      int maxArcId() const { return -1; }
   1.227  
   1.228        void first(Node&) const {}
   1.229        void next(Node&) const {}
   1.230 @@ -389,9 +389,9 @@
   1.231        Arc fromId(int, Arc) const { return INVALID; }
   1.232  
   1.233        // Dummy parameter.
   1.234 -      int maxId(Node) const { return -1; } 
   1.235 +      int maxId(Node) const { return -1; }
   1.236        // Dummy parameter.
   1.237 -      int maxId(Arc) const { return -1; } 
   1.238 +      int maxId(Arc) const { return -1; }
   1.239  
   1.240        /// \brief The base node of the iterator.
   1.241        ///
   1.242 @@ -423,10 +423,10 @@
   1.243        Node oppositeNode(const Node&, const Arc&) const { return INVALID; }
   1.244  
   1.245        /// \brief Read write map of the nodes to type \c T.
   1.246 -      /// 
   1.247 +      ///
   1.248        /// ReadWrite map of the nodes to type \c T.
   1.249        /// \sa Reference
   1.250 -      template<class T> 
   1.251 +      template<class T>
   1.252        class NodeMap : public ReadWriteMap< Node, T > {
   1.253        public:
   1.254  
   1.255 @@ -439,9 +439,9 @@
   1.256          NodeMap(const NodeMap& nm) : ReadWriteMap< Node, T >(nm) { }
   1.257          ///Assignment operator
   1.258          template <typename CMap>
   1.259 -        NodeMap& operator=(const CMap&) { 
   1.260 +        NodeMap& operator=(const CMap&) {
   1.261            checkConcept<ReadMap<Node, T>, CMap>();
   1.262 -          return *this; 
   1.263 +          return *this;
   1.264          }
   1.265        };
   1.266  
   1.267 @@ -449,7 +449,7 @@
   1.268        ///
   1.269        /// Reference map of the arcs to type \c T.
   1.270        /// \sa Reference
   1.271 -      template<class T> 
   1.272 +      template<class T>
   1.273        class ArcMap : public ReadWriteMap<Arc,T> {
   1.274        public:
   1.275  
   1.276 @@ -461,9 +461,9 @@
   1.277          ArcMap(const ArcMap& em) : ReadWriteMap<Arc,T>(em) { }
   1.278          ///Assignment operator
   1.279          template <typename CMap>
   1.280 -        ArcMap& operator=(const CMap&) { 
   1.281 +        ArcMap& operator=(const CMap&) {
   1.282            checkConcept<ReadMap<Arc, T>, CMap>();
   1.283 -          return *this; 
   1.284 +          return *this;
   1.285          }
   1.286        };
   1.287  
   1.288 @@ -471,14 +471,14 @@
   1.289        struct Constraints {
   1.290          void constraints() {
   1.291            checkConcept<IterableDigraphComponent<>, _Digraph>();
   1.292 -	  checkConcept<IDableDigraphComponent<>, _Digraph>();
   1.293 +          checkConcept<IDableDigraphComponent<>, _Digraph>();
   1.294            checkConcept<MappableDigraphComponent<>, _Digraph>();
   1.295          }
   1.296        };
   1.297  
   1.298      };
   1.299 -    
   1.300 -  } //namespace concepts  
   1.301 +
   1.302 +  } //namespace concepts
   1.303  } //namespace lemon
   1.304  
   1.305