Path Class Template Reference
[Path Structures]

#include <lemon/path.h>

List of all members.


Detailed Description

template<typename Graph>
class lemon::Path< Graph >

A structure for representing directed path in a graph.
Parameters:
Graph The graph type in which the path is.
In a sense, the path can be treated as a graph, for is has NodeIt and EdgeIt with the same usage. These types converts to the Node and Edge of the original graph.

Todo:
Thoroughfully check all the range and consistency tests.


Public Types

typedef Graph::Edge Edge
 Edge type of the underlying graph.
typedef Graph::Node Node
 Node type of the underlying graph.

Public Member Functions

 Path (const Graph &_graph)
 Constructor.
 Path (const Path &other, const NodeIt &a, const NodeIt &b)
 Subpath constructor.
 Path (const Path &other, const EdgeIt &a, const EdgeIt &b)
 Subpath constructor.
int length () const
 Length of the path.
bool empty () const
 Returns whether the path is empty.
void clear ()
 Resets the path to an empty path.
Node source () const
 Starting point of the path.
Node target () const
 End point of the path.
NodeIt nthNode (int n) const
 Gives back a node iterator to point to the node of a given index.
EdgeIt nthEdge (int n) const
 Gives back an edge iterator to point to the edge of a given index.
NodeIt source (const EdgeIt &e) const
 Returns node iterator pointing to the source node of the given edge iterator.
NodeIt target (const EdgeIt &e) const
 Returns node iterator pointing to the target node of the given edge iterator.

Classes

class  Builder
 Class to build paths. More...
class  EdgeIt
 Iterator class to iterate on the edges of the paths. More...
class  NodeIt
 Iterator class to iterate on the nodes of the paths. More...


Constructor & Destructor Documentation

Path ( const Graph &  _graph  )  [inline]

Constructor

Parameters:
_G The graph in which the path is.

Path ( const Path< Graph > &  other,
const NodeIt a,
const NodeIt b 
) [inline]

Subpath defined by two nodes.

Warning:
It is an error if the two edges are not in order!

Path ( const Path< Graph > &  other,
const EdgeIt a,
const EdgeIt b 
) [inline]

Subpath defined by two edges. Contains edges in [a,b)

Warning:
It is an error if the two edges are not in order!


Member Function Documentation

int length (  )  const [inline]

The number of the edges in the path. It can be zero if the path has only one node or it is empty.

bool empty (  )  const [inline]

Returns true when the path does not contain neither edge nor node.

void clear (  )  [inline]

Resets the path to an empty path.

Node source (  )  const [inline]

Starting point of the path. Returns INVALID if the path is empty.

Node target (  )  const [inline]

End point of the path. Returns INVALID if the path is empty.

NodeIt nthNode ( int  n  )  const [inline]

Gives back a node iterator to point to the node of a given index.

Precondition:
n should less or equal to length()

EdgeIt nthEdge ( int  n  )  const [inline]

Gives back an edge iterator to point to the node of a given index.

Precondition:
n should less than length()

NodeIt source ( const EdgeIt e  )  const [inline]

Returns node iterator pointing to the source node of the given edge iterator.

NodeIt target ( const EdgeIt e  )  const [inline]

Returns node iterator pointing to the target node of the given edge iterator.


The documentation for this class was generated from the following file:
Generated on Tue Oct 31 09:51:18 2006 for LEMON by  doxygen 1.5.1