GridGraphBase Class Reference

#include <lemon/grid_graph.h>

List of all members.


Detailed Description

Base graph for grid graph. It describes some member functions which can be used in the GridGraph.

Warning:
Always use the GridGraph instead of this.
See also:
GridGraph


Public Member Functions

Node operator() (int i, int j) const
 The node on the given position.
int row (Node n) const
 Gives back the row index of the node.
int col (Node n) const
 Gives back the coloumn index of the node.
int width () const
 Gives back the width of the graph.
int height () const
 Gives back the height of the graph.
int nodeNum () const
 Number of nodes.
int edgeNum () const
 Number of edges.
int maxNodeId () const
 Maximum node ID.
int maxEdgeId () const
 Maximum edge ID.
Node source (Edge e) const
 Gives back the source node of an edge.
Node target (Edge e) const
 Gives back the target node of an edge.
Edge findEdge (Node u, Node v, Edge prev=INVALID) const
 Finds an edge between two nodes.

Static Public Member Functions

static int id (Node v)
 Node ID.
static int id (Edge e)
 Edge ID.

Protected Member Functions

void construct (int width, int height)
 Creates a grid graph with the given size.
Edge _down (Node n) const
 Gives back the edge goes down from the node.
Edge _up (Node n) const
 Gives back the edge comes from up into the node.
Edge _right (Node n) const
 Gives back the edge goes right from the node.
Edge _left (Node n) const
 Gives back the edge comes from left into the node.


Member Function Documentation

void construct int  width,
int  height
[inline, protected]
 

Creates a grid graph with the given size.

Edge _down Node  n  )  const [inline, protected]
 

Gives back the edge goes down from the node. If there is not outgoing edge then it gives back INVALID.

Edge _up Node  n  )  const [inline, protected]
 

Gives back the edge comes from up into the node. If there is not incoming edge then it gives back INVALID.

Edge _right Node  n  )  const [inline, protected]
 

Gives back the edge goes right from the node. If there is not outgoing edge then it gives back INVALID.

Edge _left Node  n  )  const [inline, protected]
 

Gives back the edge comes left up into the node. If there is not incoming edge then it gives back INVALID.

Node operator() int  i,
int  j
const [inline]
 

Gives back the node on the given position.

int row Node  n  )  const [inline]
 

Gives back the row index of the node.

int col Node  n  )  const [inline]
 

Gives back the coloumn index of the node.

int width  )  const [inline]
 

Gives back the width of the graph.

int height  )  const [inline]
 

Gives back the height of the graph.

int maxNodeId  )  const [inline]
 

Maximum node ID.

See also:
id(Node)

int maxEdgeId  )  const [inline]
 

Maximum edge ID.

See also:
id(Edge)

Node source Edge  e  )  const [inline]
 

Gives back the source node of an edge.

Node target Edge  e  )  const [inline]
 

Gives back the target node of an edge.

static int id Node  v  )  [inline, static]
 

The ID of a valid Node is a nonnegative integer not greater than maxNodeId(). The range of the ID's is not surely continuous and the greatest node ID can be actually less then maxNodeId().

The ID of the INVALID node is -1.

Returns:
The ID of the node v.

static int id Edge  e  )  [inline, static]
 

The ID of a valid Edge is a nonnegative integer not greater than maxEdgeId(). The range of the ID's is not surely continuous and the greatest edge ID can be actually less then maxEdgeId().

The ID of the INVALID edge is -1.

Returns:
The ID of the edge e.

Edge findEdge Node  u,
Node  v,
Edge  prev = INVALID
const [inline]
 

Finds an edge from node u to node v.

If prev is INVALID (this is the default value), then It finds the first edge from u to v. Otherwise it looks for the next edge from u to v after prev.

Returns:
The found edge or INVALID if there is no such an edge.


The documentation for this class was generated from the following file:
Generated on Fri Feb 3 18:41:38 2006 for LEMON by  doxygen 1.4.6