lemon/full_graph.h
changeset 778 a143f19f465b
parent 617 4137ef9aacc6
child 780 580af8cf2f6a
equal deleted inserted replaced
6:2043d91a056f 8:8cc44936500d
    49 
    49 
    50     typedef True NodeNumTag;
    50     typedef True NodeNumTag;
    51     typedef True ArcNumTag;
    51     typedef True ArcNumTag;
    52 
    52 
    53     Node operator()(int ix) const { return Node(ix); }
    53     Node operator()(int ix) const { return Node(ix); }
    54     int index(const Node& node) const { return node._id; }
    54     static int index(const Node& node) { return node._id; }
    55 
    55 
    56     Arc arc(const Node& s, const Node& t) const {
    56     Arc arc(const Node& s, const Node& t) const {
    57       return Arc(s._id * _node_num + t._id);
    57       return Arc(s._id * _node_num + t._id);
    58     }
    58     }
    59 
    59 
   207     ///
   207     ///
   208     /// Returns the index of the given node. Since it is a static
   208     /// Returns the index of the given node. Since it is a static
   209     /// digraph its nodes can be indexed with integers from the range
   209     /// digraph its nodes can be indexed with integers from the range
   210     /// <tt>[0..nodeNum()-1]</tt>.
   210     /// <tt>[0..nodeNum()-1]</tt>.
   211     /// \sa operator()
   211     /// \sa operator()
   212     int index(const Node& node) const { return Parent::index(node); }
   212     static int index(const Node& node) { return Parent::index(node); }
   213 
   213 
   214     /// \brief Returns the arc connecting the given nodes.
   214     /// \brief Returns the arc connecting the given nodes.
   215     ///
   215     ///
   216     /// Returns the arc connecting the given nodes.
   216     /// Returns the arc connecting the given nodes.
   217     Arc arc(const Node& u, const Node& v) const {
   217     Arc arc(const Node& u, const Node& v) const {
   281     }
   281     }
   282 
   282 
   283   public:
   283   public:
   284 
   284 
   285     Node operator()(int ix) const { return Node(ix); }
   285     Node operator()(int ix) const { return Node(ix); }
   286     int index(const Node& node) const { return node._id; }
   286     static int index(const Node& node) { return node._id; }
   287 
   287 
   288     Edge edge(const Node& u, const Node& v) const {
   288     Edge edge(const Node& u, const Node& v) const {
   289       if (u._id < v._id) {
   289       if (u._id < v._id) {
   290         return Edge(_eid(u._id, v._id));
   290         return Edge(_eid(u._id, v._id));
   291       } else if (u._id != v._id) {
   291       } else if (u._id != v._id) {
   578     ///
   578     ///
   579     /// Returns the index of the given node. Since it is a static
   579     /// Returns the index of the given node. Since it is a static
   580     /// graph its nodes can be indexed with integers from the range
   580     /// graph its nodes can be indexed with integers from the range
   581     /// <tt>[0..nodeNum()-1]</tt>.
   581     /// <tt>[0..nodeNum()-1]</tt>.
   582     /// \sa operator()
   582     /// \sa operator()
   583     int index(const Node& node) const { return Parent::index(node); }
   583     static int index(const Node& node) { return Parent::index(node); }
   584 
   584 
   585     /// \brief Returns the arc connecting the given nodes.
   585     /// \brief Returns the arc connecting the given nodes.
   586     ///
   586     ///
   587     /// Returns the arc connecting the given nodes.
   587     /// Returns the arc connecting the given nodes.
   588     Arc arc(const Node& s, const Node& t) const {
   588     Arc arc(const Node& s, const Node& t) const {