# Changeset 823:eff1caf6d32e in lemon for lemon

Ignore:
Timestamp:
09/29/09 10:39:20 (11 years ago)
Branch:
default
Children:
824:5764dd9b6e18, 825:a143f19f465b
Phase:
public
Message:

Extend the interface of StaticDigraph? (#68)
with index(), arc() and node() functions similarly to
other static graph structures.

File:
1 edited

Unmodified
Removed
• ## lemon/static_graph.h

 r822 /// support any other modification of the digraph. /// /// Since this digraph structure is completely static, its nodes and arcs /// can be indexed with integers from the ranges [0..nodeNum()-1] /// and [0..arcNum()-1], respectively. /// The index of an item is the same as its ID, it can be obtained /// using the corresponding \ref index() or \ref concepts::Digraph::id() /// "id()" function. A node or arc with a certain index can be obtained /// using node() or arc(). /// /// This type fully conforms to the \ref concepts::Digraph "Digraph concept". /// Most of its member functions and nested classes are documented public: /// \brief Clear the digraph. /// /// This function erases all nodes and arcs from the digraph. void clear() { Parent::clear(); } /// \brief Constructor /// /// Default constructor. StaticDigraph() : Parent() {} /// \brief The node with the given index. /// /// This function returns the node with the given index. /// \sa index() Node node(int ix) const { return Parent::nodeFromId(ix); } /// \brief The arc with the given index. /// /// This function returns the arc with the given index. /// \sa index() Arc arc(int ix) const { return Parent::arcFromId(ix); } /// \brief The index of the given node. /// /// This function returns the index of the the given node. /// \sa node() int index(Node node) const { return Parent::id(node); } /// \brief The index of the given arc. /// /// This function returns the index of the the given arc. /// \sa arc() int index(Arc arc) const { return Parent::id(arc); } /// \brief Number of nodes. /// /// This function returns the number of nodes. int nodeNum() const { return node_num; } /// \brief Number of arcs. /// /// This function returns the number of arcs. int arcNum() const { return arc_num; } /// \brief Build the digraph copying another digraph. /// } /// \brief Clear the digraph. /// /// This function erases all nodes and arcs from the digraph. void clear() { Parent::clear(); } protected:
Note: See TracChangeset for help on using the changeset viewer.