All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions
FullDigraph Class Reference

Detailed Description

FullDigraph is a simple and fast implmenetation of directed full (complete) graphs. It contains an arc from each node to each node (including a loop for each node), therefore the number of arcs is the square of the number of nodes. This class is completely static and it needs constant memory space. Thus you can neither add nor delete nodes or arcs, however the structure can be resized using resize().

This type fully conforms to the Digraph concept. Most of its member functions and nested classes are documented only in the concept class.

This class provides constant time counting for nodes and arcs.

Note
FullDigraph and FullGraph classes are very similar, but there are two differences. While this class conforms only to the Digraph concept, FullGraph conforms to the Graph concept, moreover FullGraph does not contain a loop for each node as this class does.
See Also
FullGraph

#include <lemon/full_graph.h>

Inherits DigraphExtender< Base >.

Public Member Functions

 FullDigraph ()
 Default constructor. More...
 
 FullDigraph (int n)
 Constructor. More...
 
void resize (int n)
 Resizes the digraph. More...
 
Node operator() (int ix) const
 Returns the node with the given index. More...
 
Arc arc (Node u, Node v) const
 Returns the arc connecting the given nodes. More...
 
int nodeNum () const
 Number of nodes.
 
int arcNum () const
 Number of arcs.
 

Static Public Member Functions

static int index (const Node &node)
 Returns the index of the given node. More...
 

Constructor & Destructor Documentation

FullDigraph ( )
inline

Default constructor. The number of nodes and arcs will be zero.

FullDigraph ( int  n)
inline

Constructor.

Parameters
nThe number of the nodes.

Member Function Documentation

void resize ( int  n)
inline

This function resizes the digraph. It fully destroys and rebuilds the structure, therefore the maps of the digraph will be reallocated automatically and the previous values will be lost.

Node operator() ( int  ix) const
inline

Returns the node with the given index. Since this structure is completely static, the nodes can be indexed with integers from the range [0..nodeNum()-1]. The index of a node is the same as its ID.

See Also
index()
static int index ( const Node &  node)
inlinestatic

Returns the index of the given node. Since this structure is completely static, the nodes can be indexed with integers from the range [0..nodeNum()-1]. The index of a node is the same as its ID.

See Also
operator()()
Arc arc ( Node  u,
Node  v 
) const
inline

Returns the arc connecting the given nodes.