MTK++ Latest version: 0.2.0

Public Member Functions | Public Attributes | Protected Types | Protected Attributes
MTKpp::graph Class Reference

Container for graphs. More...

#include <mtkpp/src/Graph/graph.h>

Collaboration diagram for MTKpp::graph:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 graph ()
 graph Constructor
 graph (graph *g)
 Copy Constructor.
virtual ~graph ()
 graph Destructor
vertexaddVertex ()
 add vertex
vertexaddVertex (int index)
 add vertex
vertexaddVertex (vertex *v)
 add vertex
vertexgetVertex (std::string n)
 get vertex
vertexgetVertex (int n)
 get vertex
std::vector< vertex * > getVertices ()
 get vertices
void addEdge (vertex *a, vertex *b)
 Add an edge between a and b.
edgegetEdge (vertex *a, vertex *b)
 Get an edge between a and b.
bool hasEdge (int i, int j)
 Get an edge between a and b.
void delEdge (int i, int j)
 Delete an edge between a and b.
std::map< int, edge * > getEdges ()
 get edeges
void dfs (vertex *v)
 Depth-first search.
void reset ()
 Rest.
unsigned int getNumVertices ()

Public Attributes

int counter

Protected Types

typedef std::map< int, edge * >
::iterator 
edgeIterator
 vertices iterator

Protected Attributes

vertexpVertex
 vertex pointer
edgepEdge
 edge pointer
std::vector< vertex * > itsVertices
 list of vertices
std::map< int, edge * > itsEdges
 edge map
int vertexIndex
 vertex index
int edgeIndex
 edge index
unsigned int maxEdges
 max edges

Detailed Description

Container for graphs.

Author:
Martin Peters
Version:
0.1
Date:
2006

Member Typedef Documentation

typedef std::map<int, edge*>::iterator MTKpp::graph::edgeIterator [protected]

vertices iterator

edge map iterator


Constructor & Destructor Documentation

MTKpp::graph::graph ( )

graph Constructor

References counter, MTKpp::MAXATOMS, maxEdges, and vertexIndex.

MTKpp::graph::graph ( graph g)

Copy Constructor.

Parameters:
ggraph pointer

References addEdge(), addVertex(), counter, getVertex(), getVertices(), hasEdge(), MTKpp::MAXATOMS, maxEdges, and vertexIndex.

MTKpp::graph::~graph ( ) [virtual]

graph Destructor

References itsEdges, and itsVertices.


Member Function Documentation

vertex * MTKpp::graph::addVertex ( )
vertex * MTKpp::graph::addVertex ( int  index)

add vertex

Parameters:
indexvertex index
Returns:
vertex pointer

References itsVertices, pVertex, and MTKpp::vertex::setIndex().

vertex * MTKpp::graph::addVertex ( vertex v)

add vertex

Parameters:
vvertex pointer
Returns:
vertex pointer

References MTKpp::vertex::getIndex(), itsVertices, pVertex, MTKpp::vertex::setIndex(), and vertexIndex.

vertex * MTKpp::graph::getVertex ( std::string  n)

get vertex

Parameters:
nname
Returns:
vertex pointer

References itsVertices.

Referenced by graph(), MTKpp::hydrophobize::run(), and MTKpp::hybridize::runLabute().

vertex * MTKpp::graph::getVertex ( int  n)

get vertex

Parameters:
nindex
Returns:
vertex pointer

References itsVertices.

std::vector< vertex * > MTKpp::graph::getVertices ( )

get vertices

Returns:
vertex list

References itsVertices.

Referenced by graph(), MTKpp::hydrophobize::run(), MTKpp::hybridize::runLabute(), and MTKpp::complex::setCoreFragment().

void MTKpp::graph::addEdge ( vertex a,
vertex b 
)
edge * MTKpp::graph::getEdge ( vertex a,
vertex b 
)

Get an edge between a and b.

Parameters:
avertex pointer 1
bvertex pointer 2
Returns:
edge pointer

References edgeIndex, MTKpp::vertex::getIndex(), MTKpp::indexAB(), itsEdges, and maxEdges.

Referenced by dfs().

bool MTKpp::graph::hasEdge ( int  i,
int  j 
)

Get an edge between a and b.

Parameters:
ivertex index 1
jvertex index 2
Returns:
bool

References edgeIndex, MTKpp::indexAB(), itsEdges, and maxEdges.

Referenced by graph(), MTKpp::hydrophobize::run(), and MTKpp::hybridize::runLabute().

void MTKpp::graph::delEdge ( int  i,
int  j 
)

Delete an edge between a and b.

Parameters:
ivertex index 1
jvertex index 2
Returns:
bool

References MTKpp::vertex::delNeighbor(), edgeIndex, MTKpp::indexAB(), itsEdges, maxEdges, pEdge, MTKpp::edge::v1, and MTKpp::edge::v2.

std::map< int, edge * > MTKpp::graph::getEdges ( )

get edeges

Returns:
edge list

References itsEdges.

Referenced by MTKpp::hybridize::runLabute().

void MTKpp::graph::dfs ( vertex v)
void MTKpp::graph::reset ( )
unsigned int MTKpp::graph::getNumVertices ( )

References itsVertices.


Member Data Documentation

Referenced by dfs(), and graph().

vertex pointer

Referenced by addVertex().

edge* MTKpp::graph::pEdge [protected]

edge pointer

Referenced by addEdge(), delEdge(), dfs(), and reset().

std::vector<vertex*> MTKpp::graph::itsVertices [protected]

list of vertices

Referenced by addVertex(), getNumVertices(), getVertex(), getVertices(), reset(), and ~graph().

std::map<int, edge*> MTKpp::graph::itsEdges [protected]

edge map

Referenced by addEdge(), delEdge(), getEdge(), getEdges(), hasEdge(), reset(), and ~graph().

int MTKpp::graph::vertexIndex [protected]

vertex index

Referenced by addVertex(), and graph().

int MTKpp::graph::edgeIndex [protected]

edge index

Referenced by addEdge(), delEdge(), getEdge(), and hasEdge().

unsigned int MTKpp::graph::maxEdges [protected]

max edges

Referenced by addEdge(), delEdge(), getEdge(), graph(), and hasEdge().


The documentation for this class was generated from the following files:

Generated on Fri Dec 23 2011 09:28:55 for MTK++ by Doxygen 1.7.5.1