UGraphIterator Class Referencea class for iterating through an undirected graph
More...
#include <UGraphIterator.h>
Inheritance diagram for UGraphIterator:
[legend]List of all members.
Detailed Description
a class for iterating through an undirected graph
Base General utility routines - See also:
- UGraphIterator.h
UGraphIterator.cc
UGraphIterator.h
This module contains the structures needed to represent an Iterator through the edges in a given undirected graph.
The class can be used in two ways:
1. to iterate through all possible connections between a set of nodes, or 2. to iterate through all edges in an existing graph
The first way is triggered by using the constructor form UGraphIterator( int nodes ). This simply indicates the number of nodes, and edges are successively returned from all possible edges.
The second way is triggered by using the constructor form UGraphIterator( UGraph graph ). This simply indicates that the existing nodes in the given graph are to be successively returned.
Notice that the first way can be achieved by giving a "complete" graph (also known as a clique) to the constructor implementing the second way.
The philosophy of this iterator, concerning calls to "reset()" is that it will go back to the beginning, finding the first edge in the current graph. It will make no attempt to return to the original graph. That would require making an extra copy of the original graph at every constructor call, and it is not anticipated that this would be a popular feature.
Definition at line 59 of file UGraphIterator.h.
Constructor & Destructor Documentation
| UGraphIterator::UGraphIterator |
( |
|
) |
|
|
| UGraphIterator::UGraphIterator |
( |
int |
number_of_nodes, |
|
|
UGraphtype |
= UFULL |
|
) |
|
|
| UGraphIterator::UGraphIterator |
( |
UGraph & |
graph |
) |
|
|
Member Function Documentation
| void UGraphIterator::add_edge |
( |
int |
node1, |
|
|
int |
node2 |
|
) |
|
|
| void UGraphIterator::combine_nodes |
( |
int |
node1, |
|
|
int |
node2 |
|
) |
|
|
| void UGraphIterator::coalesce_nodes |
( |
int |
node1, |
|
|
int |
node2 |
|
) |
|
|
| bool UGraphIterator::valid |
( |
|
) |
|
|
| UEdge & UGraphIterator::current |
( |
|
) |
|
|
| void UGraphIterator::operator++ |
( |
|
) |
|
|
| void UGraphIterator::next |
( |
|
) |
|
|
| void UGraphIterator::reset |
( |
void |
|
) |
|
|
| bool UGraphIterator::end |
( |
|
) |
|
|
| void UGraphIterator::print |
( |
ostream & |
o |
) |
const [virtual] |
|
| Listable * UGraphIterator::listable_clone |
( |
|
) |
const [virtual] |
|
Friends And Related Function Documentation
| ostream& operator<< |
( |
ostream & |
o, |
|
|
const UGraphIterator & |
ad |
|
) |
[friend] |
|
Member Data Documentation
The documentation for this class was generated from the following files:
|