lemon/concepts/graph_components.h
changeset 669 4faca85d40e6
parent 617 4137ef9aacc6
child 734 bd72f8d20f33
child 975 b873350e6258
equal deleted inserted replaced
16:7ae9bc586e4b 17:5a8be9f58a10
    69       /// \brief Assignment operator.
    69       /// \brief Assignment operator.
    70       ///
    70       ///
    71       /// Assignment operator for the item.
    71       /// Assignment operator for the item.
    72       GraphItem& operator=(const GraphItem&) { return *this; }
    72       GraphItem& operator=(const GraphItem&) { return *this; }
    73 
    73 
       
    74       /// \brief Assignment operator for INVALID.
       
    75       ///
       
    76       /// This operator makes the item invalid.
       
    77       GraphItem& operator=(Invalid) { return *this; }
       
    78 
    74       /// \brief Equality operator.
    79       /// \brief Equality operator.
    75       ///
    80       ///
    76       /// Equality operator.
    81       /// Equality operator.
    77       bool operator==(const GraphItem&) const { return false; }
    82       bool operator==(const GraphItem&) const { return false; }
    78 
    83 
    94 
    99 
    95       template<typename _GraphItem>
   100       template<typename _GraphItem>
    96       struct Constraints {
   101       struct Constraints {
    97         void constraints() {
   102         void constraints() {
    98           _GraphItem i1;
   103           _GraphItem i1;
       
   104           i1=INVALID;
    99           _GraphItem i2 = i1;
   105           _GraphItem i2 = i1;
   100           _GraphItem i3 = INVALID;
   106           _GraphItem i3 = INVALID;
   101 
   107 
   102           i1 = i2 = i3;
   108           i1 = i2 = i3;
   103 
   109 
   219         ///
   225         ///
   220         /// Constructor for conversion from an arc.
   226         /// Constructor for conversion from an arc.
   221         /// Besides the core graph item functionality each arc should
   227         /// Besides the core graph item functionality each arc should
   222         /// be convertible to the represented edge.
   228         /// be convertible to the represented edge.
   223         Edge(const Arc&) {}
   229         Edge(const Arc&) {}
   224 
   230      };
   225         /// \brief Assign an arc to an edge.
       
   226         ///
       
   227         /// This function assigns an arc to an edge.
       
   228         /// Besides the core graph item functionality each arc should
       
   229         /// be convertible to the represented edge.
       
   230         Edge& operator=(const Arc&) { return *this; }
       
   231       };
       
   232 
   231 
   233       /// \brief Return one end node of an edge.
   232       /// \brief Return one end node of an edge.
   234       ///
   233       ///
   235       /// This function returns one end node of an edge.
   234       /// This function returns one end node of an edge.
   236       Node u(const Edge&) const { return INVALID; }
   235       Node u(const Edge&) const { return INVALID; }
   351       struct Constraints {
   350       struct Constraints {
   352 
   351 
   353         void constraints() {
   352         void constraints() {
   354           checkConcept<Base, _Digraph >();
   353           checkConcept<Base, _Digraph >();
   355           typename _Digraph::Node node;
   354           typename _Digraph::Node node;
       
   355           node=INVALID;
   356           int nid = digraph.id(node);
   356           int nid = digraph.id(node);
   357           nid = digraph.id(node);
   357           nid = digraph.id(node);
   358           node = digraph.nodeFromId(nid);
   358           node = digraph.nodeFromId(nid);
   359           typename _Digraph::Arc arc;
   359           typename _Digraph::Arc arc;
       
   360           arc=INVALID;
   360           int eid = digraph.id(arc);
   361           int eid = digraph.id(arc);
   361           eid = digraph.id(arc);
   362           eid = digraph.id(arc);
   362           arc = digraph.arcFromId(eid);
   363           arc = digraph.arcFromId(eid);
   363 
   364 
   364           nid = digraph.maxNodeId();
   365           nid = digraph.maxNodeId();