lemon/static_graph.h
changeset 778 a143f19f465b
parent 776 eff1caf6d32e
child 779 c160bf9f18ef
equal deleted inserted replaced
3:b924f16b1e02 5:019e15e9518d
    90     void nextOut(Arc& e) const { e.id = arc_next_out[e.id]; }
    90     void nextOut(Arc& e) const { e.id = arc_next_out[e.id]; }
    91 
    91 
    92     void firstIn(Arc& e, const Node& n) const { e.id = node_first_in[n.id]; }
    92     void firstIn(Arc& e, const Node& n) const { e.id = node_first_in[n.id]; }
    93     void nextIn(Arc& e) const { e.id = arc_next_in[e.id]; }
    93     void nextIn(Arc& e) const { e.id = arc_next_in[e.id]; }
    94 
    94 
    95     int id(const Node& n) const { return n.id; }
    95     static int id(const Node& n) { return n.id; }
    96     Node nodeFromId(int id) const { return Node(id); }
    96     static Node nodeFromId(int id) { return Node(id); }
    97     int maxNodeId() const { return node_num - 1; }
    97     int maxNodeId() const { return node_num - 1; }
    98 
    98 
    99     int id(const Arc& e) const { return e.id; }
    99     static int id(const Arc& e) { return e.id; }
   100     Arc arcFromId(int id) const { return Arc(id); }
   100     static Arc arcFromId(int id) { return Arc(id); }
   101     int maxArcId() const { return arc_num - 1; }
   101     int maxArcId() const { return arc_num - 1; }
   102 
   102 
   103     typedef True NodeNumTag;
   103     typedef True NodeNumTag;
   104     typedef True ArcNumTag;
   104     typedef True ArcNumTag;
   105 
   105 
   266 
   266 
   267     /// \brief The node with the given index.
   267     /// \brief The node with the given index.
   268     ///
   268     ///
   269     /// This function returns the node with the given index.
   269     /// This function returns the node with the given index.
   270     /// \sa index()
   270     /// \sa index()
   271     Node node(int ix) const { return Parent::nodeFromId(ix); }
   271     static Node node(int ix) { return Parent::nodeFromId(ix); }
   272 
   272 
   273     /// \brief The arc with the given index.
   273     /// \brief The arc with the given index.
   274     ///
   274     ///
   275     /// This function returns the arc with the given index.
   275     /// This function returns the arc with the given index.
   276     /// \sa index()
   276     /// \sa index()
   277     Arc arc(int ix) const { return Parent::arcFromId(ix); }
   277     static Arc arc(int ix) { return Parent::arcFromId(ix); }
   278 
   278 
   279     /// \brief The index of the given node.
   279     /// \brief The index of the given node.
   280     ///
   280     ///
   281     /// This function returns the index of the the given node.
   281     /// This function returns the index of the the given node.
   282     /// \sa node()
   282     /// \sa node()
   283     int index(Node node) const { return Parent::id(node); }
   283     static int index(Node node) { return Parent::id(node); }
   284 
   284 
   285     /// \brief The index of the given arc.
   285     /// \brief The index of the given arc.
   286     ///
   286     ///
   287     /// This function returns the index of the the given arc.
   287     /// This function returns the index of the the given arc.
   288     /// \sa arc()
   288     /// \sa arc()
   289     int index(Arc arc) const { return Parent::id(arc); }
   289     static int index(Arc arc) { return Parent::id(arc); }
   290 
   290 
   291     /// \brief Number of nodes.
   291     /// \brief Number of nodes.
   292     ///
   292     ///
   293     /// This function returns the number of nodes.
   293     /// This function returns the number of nodes.
   294     int nodeNum() const { return node_num; }
   294     int nodeNum() const { return node_num; }