class digraph

A directed graph

Inheritance:


Public Methods

[more] digraph()
[more] digraph(unsigned capacity, unsigned grow = DEFAULT_CONTAINER_GROWTH)
[more]inline unsigned verticeCount() const
Returns the number of vertices in the graph
[more]inline unsigned edgeCount() const
Returns the number of edges in the graph
[more]bool adjacent(const object &u, const object &v) const
True if (u, v) is an edge, false otherwise
[more]bool hasVertice(const object &u) const
True if u is a vertice, false otherwise
[more]const indexed* neighbors(const object &u) const
Returns an indexed list of u's neighbors.
[more]void addVertice(object* u)
Adds the object u to the graph
[more]void addEdge(const object &u, const object &v)
Adds and edge (u, v) using u, v stored in the vertice list.
[more]object* removeVertice(const object &u)
Removes u's representation in the graph.
[more]void removeEdge(const object &u, const object &v)
Removes the edge (u, v).
[more] ~digraph()
Deletes structure only.


Inherited from object:

Public Methods

ovirtual bool operator==(const object &obj) const
ovirtual bool operator!=(const object &obj) const
ovirtual unsigned int hashcode() const
ovirtual object* clone() const


Documentation

A directed graph
o digraph()

o digraph(unsigned capacity, unsigned grow = DEFAULT_CONTAINER_GROWTH)

oinline unsigned verticeCount() const
Returns the number of vertices in the graph

oinline unsigned edgeCount() const
Returns the number of edges in the graph

obool adjacent(const object &u, const object &v) const
True if (u, v) is an edge, false otherwise

obool hasVertice(const object &u) const
True if u is a vertice, false otherwise

oconst 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.

ovoid addVertice(object* u)
Adds the object u to the graph

ovoid 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.

oobject* 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.

ovoid removeEdge(const object &u, const object &v)
Removes the edge (u, v). Undefined if (u, v) is not an edge.

o ~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++.