User:CalebKennedy/Pruner

From OpenWetWare
Jump to: navigation, search

<HTML> <HEAD> <TITLE> C++ Pruner </TITLE> <META NAME="Generator" CONTENT="EditPlus"> <META NAME="Author" CONTENT="Caleb J Kennedy"> <META NAME="Keywords" CONTENT=""> <META NAME="Description" CONTENT=""> </HEAD>

<BODY>

C++ Pruner<VertexType, EdgeType>

Pruner is a C++ template class for pruning a depth-first search within a <A href="http://openwetware.org/wiki/User:CalebKennedy/LabeledGraph">LabeledGraph</A>. <p>Public methods:

<A href="#const">Pruner constructors & destructor</A>methods to allocate, copy, and deallocate Pruners                    
<A href="#oper">Pruner operator</A>overloaded pruning method
<A href="#bktk">backtrack</A>instantiate a <A href="http://en.wikipedia.org/wiki/Backtracking">backtrack</A>
<A href="#begin">begin</A>returns an iterator to the first vertex pointer in the path
<A href="#end">end</A>returns an iterator just past the last vertex pointer in the path
<A href="#clear">clear</A>set current pathlength equal to zero
<A href="#svert">startVertex</A>returns the start vertex

<A name="const">Pruner constructors & destructor</A>

Pruner is an <A href="http://en.wikipedia.org/wiki/Class_(computer_science)#Categories_of_classes">abstract class</A>.

<A name="oper">Pruner operator</A>

virtual bool operator()(Vertex* const) = 0

The operator() is a <A href="http://en.wikipedia.org/wiki/Virtual_function">pure virtual function</A> that can be overloaded in classes that inherit from Pruner to define application- and user-specific pruning methods for depth-first traversals.

<A name="bktk">backtrack</A>

virtual void backtrack(Vertex<VertexType, EdgeType>* const) = 0

Backtrack decrements the current pathlength and declares the current vertex unvisited.

<A name="begin">begin</A>

virtual Vertex** begin(void) const

<A name="end">end</A>

virtual Vertex** end(void) const

<A name="clear">clear</A>

virtual void clear(void)

<A name="svert">startVertex</A>

Vertex* startVertex(void) const