lemon/concepts/graph.h
changeset 99 dbaa96cc1013
parent 57 c1acf0018c0a
child 78 c46b3453455f
     1.1 --- a/lemon/concepts/graph.h	Thu Jan 24 17:36:45 2008 +0000
     1.2 +++ b/lemon/concepts/graph.h	Thu Feb 07 21:28:39 2008 +0000
     1.3 @@ -624,6 +624,39 @@
     1.4        /// \brief Target node of the directed arc.
     1.5        Node target(Arc) const { return INVALID; }
     1.6  
     1.7 +      /// \brief Returns the id of the node.
     1.8 +      int id(Node) const { return -1; } 
     1.9 +
    1.10 +      /// \brief Returns the id of the edge.
    1.11 +      int id(Edge) const { return -1; } 
    1.12 +
    1.13 +      /// \brief Returns the id of the arc.
    1.14 +      int id(Arc) const { return -1; } 
    1.15 +
    1.16 +      /// \brief Returns the node with the given id.
    1.17 +      ///
    1.18 +      /// \pre The argument should be a valid node id in the graph.
    1.19 +      Node nodeFromId(int) const { return INVALID; } 
    1.20 +
    1.21 +      /// \brief Returns the edge with the given id.
    1.22 +      ///
    1.23 +      /// \pre The argument should be a valid edge id in the graph.
    1.24 +      Edge edgeFromId(int) const { return INVALID; } 
    1.25 +
    1.26 +      /// \brief Returns the arc with the given id.
    1.27 +      ///
    1.28 +      /// \pre The argument should be a valid arc id in the graph.
    1.29 +      Arc arcFromId(int) const { return INVALID; } 
    1.30 +
    1.31 +      /// \brief Returns an upper bound on the node IDs.
    1.32 +      int maxNodeId() const { return -1; } 
    1.33 +
    1.34 +      /// \brief Returns an upper bound on the edge IDs.
    1.35 +      int maxEdgeId() const { return -1; } 
    1.36 +
    1.37 +      /// \brief Returns an upper bound on the arc IDs.
    1.38 +      int maxArcId() const { return -1; } 
    1.39 +
    1.40        void first(Node&) const {}
    1.41        void next(Node&) const {}
    1.42  
    1.43 @@ -639,10 +672,23 @@
    1.44        void firstIn(Arc&, Node) const {}
    1.45        void nextIn(Arc&) const {}
    1.46  
    1.47 -
    1.48        void firstInc(Edge &, bool &, const Node &) const {}
    1.49        void nextInc(Edge &, bool &) const {}
    1.50  
    1.51 +      // The second parameter is dummy.
    1.52 +      Node fromId(int, Node) const { return INVALID; }
    1.53 +      // The second parameter is dummy.
    1.54 +      Edge fromId(int, Edge) const { return INVALID; }
    1.55 +      // The second parameter is dummy.
    1.56 +      Arc fromId(int, Arc) const { return INVALID; }
    1.57 +
    1.58 +      // Dummy parameter.
    1.59 +      int maxId(Node) const { return -1; } 
    1.60 +      // Dummy parameter.
    1.61 +      int maxId(Edge) const { return -1; } 
    1.62 +      // Dummy parameter.
    1.63 +      int maxId(Arc) const { return -1; } 
    1.64 +
    1.65        /// \brief Base node of the iterator
    1.66        ///
    1.67        /// Returns the base node (the source in this case) of the iterator
    1.68 @@ -689,6 +735,7 @@
    1.69        struct Constraints {
    1.70  	void constraints() {
    1.71  	  checkConcept<IterableGraphComponent<>, Graph>();
    1.72 +	  checkConcept<IDableGraphComponent<>, Graph>();
    1.73  	  checkConcept<MappableGraphComponent<>, Graph>();
    1.74  	}
    1.75        };