A directed graph
Inheritance:
Public Methods
-
digraph()
-
digraph(unsigned capacity, unsigned grow = DEFAULT_CONTAINER_GROWTH)
-
inline unsigned verticeCount() const
- Returns the number of vertices in the graph
-
inline unsigned edgeCount() const
- Returns the number of edges in the graph
-
bool adjacent(const object &u, const object &v) const
- True if (u, v) is an edge, false otherwise
-
bool hasVertice(const object &u) const
- True if u is a vertice, false otherwise
-
const indexed* neighbors(const object &u) const
- Returns an indexed list of u's neighbors.
-
void addVertice(object* u)
- Adds the object u to the graph
-
void addEdge(const object &u, const object &v)
- Adds and edge (u, v) using u, v stored in the vertice list.
-
object* removeVertice(const object &u)
- Removes u's representation in the graph.
-
void removeEdge(const object &u, const object &v)
- Removes the edge (u, v).
-
~digraph()
- Deletes structure only.
Inherited from object:
Public Methods
-
virtual bool operator==(const object &obj) const
-
virtual bool operator!=(const object &obj) const
-
virtual unsigned int hashcode() const
-
virtual object* clone() const
Documentation
A directed graph
digraph()
digraph(unsigned capacity, unsigned grow = DEFAULT_CONTAINER_GROWTH)
inline unsigned verticeCount() const
- Returns the number of vertices in the graph
inline unsigned edgeCount() const
- Returns the number of edges in the graph
bool adjacent(const object &u, const object &v) const
- True if (u, v) is an edge, false otherwise
bool hasVertice(const object &u) const
- True if u is a vertice, false otherwise
const indexed* neighbors(const object &u) const
-
Returns an indexed list of u's neighbors. This list is still owned by the
digraph, so it should no be tampered with.
The result is undefined if u is not a vertice in the graph.
void addVertice(object* u)
- Adds the object u to the graph
void addEdge(const object &u, const object &v)
-
Adds and edge (u, v) using u, v stored in the vertice list.
Result is undefined if u, v are not vertices.
object* removeVertice(const object &u)
-
Removes u's representation in the graph. Undefined if u is not a vertice.
Returns u's representation in the digraph.
void removeEdge(const object &u, const object &v)
- Removes the edge (u, v). Undefined if (u, v) is not an edge.
~digraph()
- Deletes structure only. The nodes are preserved.
- This class has no child classes.
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.