Public Member Functions

ctkDependencyGraph Class Reference

#include <Libs/Core/ctkDependencyGraph.h>

Collaboration diagram for ctkDependencyGraph:
Collaboration graph
[legend]

List of all members.

Public Member Functions

bool checkForCycle ()
 Traverse graph and check for cycle.
 ctkDependencyGraph (int nvertices)
bool cycleDetected ()
 Return true if there is at least one cycle.
int cycleEnd ()
 If a cycle has been detected, return the end of the cycle otherwise 0.
int cycleOrigin ()
 If a cycle has been detected, return the origin of the cycle otherwise 0.
void findPath (int from, int to, QList< int > &path)
 Retrieve the path between two vertices.
void findPaths (int from, int to, QList< QList< int > * > &paths)
void insertEdge (int from, int to)
int numberOfEdges ()
 Get the number of edges associated with current graph.
int numberOfVertices ()
 Get the number of vertices associated with current graph.
void printAdditionalInfo ()
void printGraph ()
virtual void processEdge (int, int)
 Called each time an edge is visited.
void setEdgeListToExclude (const QList< int > &list)
void setVerbose (bool verbose)
virtual bool shouldExcludeEdge (int edge)
bool topologicalSort (QList< int > &sorted)
 ~ctkDependencyGraph ()

Detailed Description

Definition at line 35 of file ctkDependencyGraph.h.


Constructor & Destructor Documentation

ctkDependencyGraph::ctkDependencyGraph ( int  nvertices  ) 

Definition at line 256 of file ctkDependencyGraph.cpp.

ctkDependencyGraph::~ctkDependencyGraph (  ) 

Definition at line 291 of file ctkDependencyGraph.cpp.


Member Function Documentation

bool ctkDependencyGraph::checkForCycle (  ) 

Traverse graph and check for cycle.

Definition at line 374 of file ctkDependencyGraph.cpp.

bool ctkDependencyGraph::cycleDetected (  ) 

Return true if there is at least one cycle.

Definition at line 386 of file ctkDependencyGraph.cpp.

int ctkDependencyGraph::cycleEnd (  ) 

If a cycle has been detected, return the end of the cycle otherwise 0.

Definition at line 398 of file ctkDependencyGraph.cpp.

int ctkDependencyGraph::cycleOrigin (  ) 

If a cycle has been detected, return the origin of the cycle otherwise 0.

Definition at line 392 of file ctkDependencyGraph.cpp.

void ctkDependencyGraph::findPath ( int  from,
int  to,
QList< int > &  path 
)

Retrieve the path between two vertices.

Definition at line 450 of file ctkDependencyGraph.cpp.

void ctkDependencyGraph::findPaths ( int  from,
int  to,
QList< QList< int > * > &  paths 
)

Retrieve the paths between two vertices Caller is responsible to clear paths list

Definition at line 423 of file ctkDependencyGraph.cpp.

void ctkDependencyGraph::insertEdge ( int  from,
int  to 
)

Insert edge (from, to) indicate a relation between two vertices Note also that vertex id should be >= 1

Definition at line 404 of file ctkDependencyGraph.cpp.

int ctkDependencyGraph::numberOfEdges (  ) 

Get the number of edges associated with current graph.

Definition at line 350 of file ctkDependencyGraph.cpp.

int ctkDependencyGraph::numberOfVertices (  ) 

Get the number of vertices associated with current graph.

Definition at line 344 of file ctkDependencyGraph.cpp.

void ctkDependencyGraph::printAdditionalInfo (  ) 

Definition at line 303 of file ctkDependencyGraph.cpp.

void ctkDependencyGraph::printGraph (  ) 

Definition at line 330 of file ctkDependencyGraph.cpp.

virtual void ctkDependencyGraph::processEdge ( int  ,
int   
) [inline, virtual]

Called each time an edge is visited.

Definition at line 86 of file ctkDependencyGraph.h.

void ctkDependencyGraph::setEdgeListToExclude ( const QList< int > &  list  ) 

List of edge to exclude An edge is specified using its extremity

Definition at line 362 of file ctkDependencyGraph.cpp.

void ctkDependencyGraph::setVerbose ( bool  verbose  ) 

Definition at line 356 of file ctkDependencyGraph.cpp.

bool ctkDependencyGraph::shouldExcludeEdge ( int  edge  )  [virtual]

The default implementation check if 'edge' is in the list of edge to exclude See setEdgeListToExclude

Definition at line 368 of file ctkDependencyGraph.cpp.

bool ctkDependencyGraph::topologicalSort ( QList< int > &  sorted  ) 

Perform a topological search Return false if the graph contains cycles See cycleDetected, cycleOrigin, cycleEnd

Definition at line 468 of file ctkDependencyGraph.cpp.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines