# Changeset 209:765619b7cbb2 in lemon for lemon/concepts/digraph.h

Ignore:
Timestamp:
07/13/08 20:51:02 (12 years ago)
Branch:
default
Phase:
public
Message:

Apply unify-sources.sh to the source tree

File:
1 edited

Unmodified
Removed
• ## lemon/concepts/digraph.h

 r125 /* -*- C++ -*- /* -*- mode: C++; indent-tabs-mode: nil; -*- * * This file is a part of LEMON, a generic C++ optimization library * This file is a part of LEMON, a generic C++ optimization library. * * Copyright (C) 2003-2008 private: ///Digraphs are \e not copy constructible. Use DigraphCopy() instead. ///Digraphs are \e not copy constructible. Use DigraphCopy() instead. /// ///\brief Assignment of \ref Digraph "Digraph"s to another ones are ///\e not allowed. Use DigraphCopy() instead. ///Assignment of \ref Digraph "Digraph"s to another ones are ///\e not allowed.  Use DigraphCopy() instead. /// Inequality operator /// \sa operator==(Node n) /// bool operator!=(Node) const { return true; } /// Artificial ordering operator. /// To allow the use of digraph descriptors as key type in std::map or /// similar associative container we require this. /// /// \note This operator only have to define some strict ordering of /// the items; this order has nothing to do with the iteration /// ordering of the items. bool operator<(Node) const { return false; } }; /// Artificial ordering operator. /// To allow the use of digraph descriptors as key type in std::map or /// similar associative container we require this. /// /// \note This operator only have to define some strict ordering of /// the items; this order has nothing to do with the iteration /// ordering of the items. bool operator<(Node) const { return false; } }; /// This iterator goes through each node. NodeIt() { } /// Copy constructor. /// Copy constructor. /// /// Node -> NodeIt conversion. /// Sets the iterator to the node of \c the digraph pointed by /// the trivial iterator. /// This feature necessitates that each time we /// Sets the iterator to the node of \c the digraph pointed by /// the trivial iterator. /// This feature necessitates that each time we /// iterate the arc-set, the iteration order is the same. NodeIt(const Digraph&, const Node&) { } NodeIt& operator++() { return *this; } }; /// Class for identifying an arc of the digraph bool operator!=(Arc) const { return true; } /// Artificial ordering operator. /// To allow the use of digraph descriptors as key type in std::map or /// similar associative container we require this. /// /// \note This operator only have to define some strict ordering of /// the items; this order has nothing to do with the iteration /// ordering of the items. bool operator<(Arc) const { return false; } }; /// Artificial ordering operator. /// To allow the use of digraph descriptors as key type in std::map or /// similar associative container we require this. /// /// \note This operator only have to define some strict ordering of /// the items; this order has nothing to do with the iteration /// ordering of the items. bool operator<(Arc) const { return false; } }; /// This iterator goes trough the outgoing arcs of a node. /// for (Digraph::OutArcIt e(g, n); e!=INVALID; ++e) ++count; ///\endcode class OutArcIt : public Arc { public: OutArcIt(Invalid) { } /// This constructor sets the iterator to the first outgoing arc. /// This constructor sets the iterator to the first outgoing arc of /// the node. /// Sets the iterator to the value of the trivial iterator. /// This feature necessitates that each time we /// This feature necessitates that each time we /// iterate the arc-set, the iteration order is the same. OutArcIt(const Digraph&, const Arc&) { } ///Next outgoing arc /// Assign the iterator to the next /// Assign the iterator to the next /// outgoing arc of the corresponding node. OutArcIt& operator++() { return *this; } InArcIt(Invalid) { } /// This constructor sets the iterator to first incoming arc. /// This constructor set the iterator to the first incoming arc of /// the node. /// Sets the iterator to the value of the trivial iterator \c e. /// This feature necessitates that each time we /// This feature necessitates that each time we /// iterate the arc-set, the iteration order is the same. InArcIt(const Digraph&, const Arc&) { } ArcIt(Invalid) { } /// This constructor sets the iterator to the first arc. /// This constructor sets the iterator to the first arc of \c g. ///@param g the digraph /// Sets the iterator to the value of the trivial iterator \c e. /// This feature necessitates that each time we /// This feature necessitates that each time we /// iterate the arc-set, the iteration order is the same. ArcIt(const Digraph&, const Arc&) { } ArcIt(const Digraph&, const Arc&) { } ///Next arc /// Assign the iterator to the next arc. ArcIt& operator++() { return *this; } /// \brief Returns the ID of the node. int id(Node) const { return -1; } int id(Node) const { return -1; } /// \brief Returns the ID of the arc. int id(Arc) const { return -1; } int id(Arc) const { return -1; } /// \brief Returns the node with the given ID. /// /// \pre The argument should be a valid node ID in the graph. Node nodeFromId(int) const { return INVALID; } Node nodeFromId(int) const { return INVALID; } /// \brief Returns the arc with the given ID. /// /// \pre The argument should be a valid arc ID in the graph. Arc arcFromId(int) const { return INVALID; } Arc arcFromId(int) const { return INVALID; } /// \brief Returns an upper bound on the node IDs. int maxNodeId() const { return -1; } int maxNodeId() const { return -1; } /// \brief Returns an upper bound on the arc IDs. int maxArcId() const { return -1; } int maxArcId() const { return -1; } void first(Node&) const {} // Dummy parameter. int maxId(Node) const { return -1; } int maxId(Node) const { return -1; } // Dummy parameter. int maxId(Arc) const { return -1; } int maxId(Arc) const { return -1; } /// \brief The base node of the iterator. /// \brief Read write map of the nodes to type \c T. /// /// /// ReadWrite map of the nodes to type \c T. /// \sa Reference template template class NodeMap : public ReadWriteMap< Node, T > { public: ///Assignment operator template NodeMap& operator=(const CMap&) { NodeMap& operator=(const CMap&) { checkConcept, CMap>(); return *this; return *this; } }; /// Reference map of the arcs to type \c T. /// \sa Reference template template class ArcMap : public ReadWriteMap { public: ///Assignment operator template ArcMap& operator=(const CMap&) { ArcMap& operator=(const CMap&) { checkConcept, CMap>(); return *this; return *this; } }; void constraints() { checkConcept, _Digraph>(); checkConcept, _Digraph>(); checkConcept, _Digraph>(); checkConcept, _Digraph>(); } }; } //namespace concepts } //namespace concepts } //namespace lemon
Note: See TracChangeset for help on using the changeset viewer.