COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
07/13/08 20:51:02 (16 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Phase:
public
Message:

Apply unify-sources.sh to the source tree

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/concepts/digraph.h

    r125 r209  
    1 /* -*- C++ -*-
     1/* -*- mode: C++; indent-tabs-mode: nil; -*-
    22 *
    3  * This file is a part of LEMON, a generic C++ optimization library
     3 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    55 * Copyright (C) 2003-2008
     
    4747    private:
    4848      ///Digraphs are \e not copy constructible. Use DigraphCopy() instead.
    49      
     49
    5050      ///Digraphs are \e not copy constructible. Use DigraphCopy() instead.
    5151      ///
     
    5353      ///\brief Assignment of \ref Digraph "Digraph"s to another ones are
    5454      ///\e not allowed. Use DigraphCopy() instead.
    55      
     55
    5656      ///Assignment of \ref Digraph "Digraph"s to another ones are
    5757      ///\e not allowed.  Use DigraphCopy() instead.
     
    9696
    9797        /// Inequality operator
    98        
     98
    9999        /// \sa operator==(Node n)
    100100        ///
    101101        bool operator!=(Node) const { return true; }
    102102
    103         /// Artificial ordering operator.
    104        
    105         /// To allow the use of digraph descriptors as key type in std::map or
    106         /// similar associative container we require this.
    107         ///
    108         /// \note This operator only have to define some strict ordering of
    109         /// the items; this order has nothing to do with the iteration
    110         /// ordering of the items.
    111         bool operator<(Node) const { return false; }
    112 
    113       };
    114    
     103        /// Artificial ordering operator.
     104
     105        /// To allow the use of digraph descriptors as key type in std::map or
     106        /// similar associative container we require this.
     107        ///
     108        /// \note This operator only have to define some strict ordering of
     109        /// the items; this order has nothing to do with the iteration
     110        /// ordering of the items.
     111        bool operator<(Node) const { return false; }
     112
     113      };
     114
    115115      /// This iterator goes through each node.
    116116
     
    130130        NodeIt() { }
    131131        /// Copy constructor.
    132        
     132
    133133        /// Copy constructor.
    134134        ///
     
    146146        /// Node -> NodeIt conversion.
    147147
    148         /// Sets the iterator to the node of \c the digraph pointed by 
    149         /// the trivial iterator.
    150         /// This feature necessitates that each time we 
     148        /// Sets the iterator to the node of \c the digraph pointed by
     149        /// the trivial iterator.
     150        /// This feature necessitates that each time we
    151151        /// iterate the arc-set, the iteration order is the same.
    152152        NodeIt(const Digraph&, const Node&) { }
     
    157157        NodeIt& operator++() { return *this; }
    158158      };
    159    
    160    
     159
     160
    161161      /// Class for identifying an arc of the digraph
    162162
     
    192192        bool operator!=(Arc) const { return true; }
    193193
    194         /// Artificial ordering operator.
    195        
    196         /// To allow the use of digraph descriptors as key type in std::map or
    197         /// similar associative container we require this.
    198         ///
    199         /// \note This operator only have to define some strict ordering of
    200         /// the items; this order has nothing to do with the iteration
    201         /// ordering of the items.
    202         bool operator<(Arc) const { return false; }
    203       };
    204    
     194        /// Artificial ordering operator.
     195
     196        /// To allow the use of digraph descriptors as key type in std::map or
     197        /// similar associative container we require this.
     198        ///
     199        /// \note This operator only have to define some strict ordering of
     200        /// the items; this order has nothing to do with the iteration
     201        /// ordering of the items.
     202        bool operator<(Arc) const { return false; }
     203      };
     204
    205205      /// This iterator goes trough the outgoing arcs of a node.
    206206
     
    214214      /// for (Digraph::OutArcIt e(g, n); e!=INVALID; ++e) ++count;
    215215      ///\endcode
    216    
     216
    217217      class OutArcIt : public Arc {
    218218      public:
     
    233233        OutArcIt(Invalid) { }
    234234        /// This constructor sets the iterator to the first outgoing arc.
    235    
     235
    236236        /// This constructor sets the iterator to the first outgoing arc of
    237237        /// the node.
     
    240240
    241241        /// Sets the iterator to the value of the trivial iterator.
    242         /// This feature necessitates that each time we
     242        /// This feature necessitates that each time we
    243243        /// iterate the arc-set, the iteration order is the same.
    244244        OutArcIt(const Digraph&, const Arc&) { }
    245245        ///Next outgoing arc
    246        
    247         /// Assign the iterator to the next 
     246
     247        /// Assign the iterator to the next
    248248        /// outgoing arc of the corresponding node.
    249249        OutArcIt& operator++() { return *this; }
     
    280280        InArcIt(Invalid) { }
    281281        /// This constructor sets the iterator to first incoming arc.
    282    
     282
    283283        /// This constructor set the iterator to the first incoming arc of
    284284        /// the node.
     
    287287
    288288        /// Sets the iterator to the value of the trivial iterator \c e.
    289         /// This feature necessitates that each time we 
     289        /// This feature necessitates that each time we
    290290        /// iterate the arc-set, the iteration order is the same.
    291291        InArcIt(const Digraph&, const Arc&) { }
     
    323323        ArcIt(Invalid) { }
    324324        /// This constructor sets the iterator to the first arc.
    325    
     325
    326326        /// This constructor sets the iterator to the first arc of \c g.
    327327        ///@param g the digraph
     
    330330
    331331        /// Sets the iterator to the value of the trivial iterator \c e.
    332         /// This feature necessitates that each time we 
     332        /// This feature necessitates that each time we
    333333        /// iterate the arc-set, the iteration order is the same.
    334         ArcIt(const Digraph&, const Arc&) { } 
     334        ArcIt(const Digraph&, const Arc&) { }
    335335        ///Next arc
    336        
     336
    337337        /// Assign the iterator to the next arc.
    338338        ArcIt& operator++() { return *this; }
     
    350350
    351351      /// \brief Returns the ID of the node.
    352       int id(Node) const { return -1; } 
     352      int id(Node) const { return -1; }
    353353
    354354      /// \brief Returns the ID of the arc.
    355       int id(Arc) const { return -1; } 
     355      int id(Arc) const { return -1; }
    356356
    357357      /// \brief Returns the node with the given ID.
    358358      ///
    359359      /// \pre The argument should be a valid node ID in the graph.
    360       Node nodeFromId(int) const { return INVALID; } 
     360      Node nodeFromId(int) const { return INVALID; }
    361361
    362362      /// \brief Returns the arc with the given ID.
    363363      ///
    364364      /// \pre The argument should be a valid arc ID in the graph.
    365       Arc arcFromId(int) const { return INVALID; } 
     365      Arc arcFromId(int) const { return INVALID; }
    366366
    367367      /// \brief Returns an upper bound on the node IDs.
    368       int maxNodeId() const { return -1; } 
     368      int maxNodeId() const { return -1; }
    369369
    370370      /// \brief Returns an upper bound on the arc IDs.
    371       int maxArcId() const { return -1; } 
     371      int maxArcId() const { return -1; }
    372372
    373373      void first(Node&) const {}
     
    390390
    391391      // Dummy parameter.
    392       int maxId(Node) const { return -1; } 
     392      int maxId(Node) const { return -1; }
    393393      // Dummy parameter.
    394       int maxId(Arc) const { return -1; } 
     394      int maxId(Arc) const { return -1; }
    395395
    396396      /// \brief The base node of the iterator.
     
    424424
    425425      /// \brief Read write map of the nodes to type \c T.
    426       /// 
     426      ///
    427427      /// ReadWrite map of the nodes to type \c T.
    428428      /// \sa Reference
    429       template<class T> 
     429      template<class T>
    430430      class NodeMap : public ReadWriteMap< Node, T > {
    431431      public:
     
    440440        ///Assignment operator
    441441        template <typename CMap>
    442         NodeMap& operator=(const CMap&) { 
     442        NodeMap& operator=(const CMap&) {
    443443          checkConcept<ReadMap<Node, T>, CMap>();
    444           return *this; 
     444          return *this;
    445445        }
    446446      };
     
    450450      /// Reference map of the arcs to type \c T.
    451451      /// \sa Reference
    452       template<class T> 
     452      template<class T>
    453453      class ArcMap : public ReadWriteMap<Arc,T> {
    454454      public:
     
    462462        ///Assignment operator
    463463        template <typename CMap>
    464         ArcMap& operator=(const CMap&) { 
     464        ArcMap& operator=(const CMap&) {
    465465          checkConcept<ReadMap<Arc, T>, CMap>();
    466           return *this; 
     466          return *this;
    467467        }
    468468      };
     
    472472        void constraints() {
    473473          checkConcept<IterableDigraphComponent<>, _Digraph>();
    474           checkConcept<IDableDigraphComponent<>, _Digraph>();
     474          checkConcept<IDableDigraphComponent<>, _Digraph>();
    475475          checkConcept<MappableDigraphComponent<>, _Digraph>();
    476476        }
     
    478478
    479479    };
    480    
    481   } //namespace concepts 
     480
     481  } //namespace concepts
    482482} //namespace lemon
    483483
Note: See TracChangeset for help on using the changeset viewer.