DiaDes  0.1
DIAgnosis of Discrete-Event System
Classes | Typedefs | Functions
Diades::Graph Namespace Reference

Namespace of the Graph library (libGraph) More...

Classes

class  BFS
 
class  ConstEdgeMap
 
class  ConstEdgeMapIterator
 
class  ConstNodeMap
 
class  ConstNodeMapIterator
 
class  DFS
 
class  Edge
 
class  EdgeData
 
class  EdgeMap
 
class  EdgeMapIterator
 
class  Graph
 
struct  GraphIterator
 
class  GraphNodeSet
 
class  GraphNodeSetTable
 
class  GraphSearch
 
class  Node
 
class  NodeData
 
class  NodeElement
 
class  NodeMap
 
class  NodeMapIterator
 

Typedefs

typedef list< Edge >::iterator InEdgeIterator
 
typedef list< Edge >::iterator OutEdgeIterator
 
typedef list< Edge >::iterator LocalEdgeIterator
 
typedef GraphIterator< NodeNodeIterator
 
typedef GraphIterator< EdgeEdgeIterator
 

Functions

template<typename T , typename ForwardIterator >
ForwardIterator initValueConstEdgeMap (ConstEdgeMap< T > &map, ForwardIterator start, ForwardIterator end, typename ConstEdgeMap< T >::ConstReference value)
 
template<typename T , typename ForwardIterator >
ForwardIterator initValueConstNodeMap (ConstNodeMap< T > &map, ForwardIterator start, ForwardIterator end, typename ConstNodeMap< T >::ConstReference value)
 
std::size_t hash_value (Diades::Graph::Edge const &e)
 
template<typename InputIterator , typename T >
InputIterator initValue (EdgeMap< T > &map, InputIterator start, InputIterator end, typename EdgeMap< T >::ConstReference value)
 
template<typename InputIterator >
void deleteEdge (Graph &g, InputIterator first, InputIterator last)
 
template<typename InputIterator >
void deleteNode (Graph &g, InputIterator first, InputIterator last)
 
template<typename InputIterator , typename Predicate >
void deleteNode (Graph &g, InputIterator first, InputIterator last, Predicate pred)
 
template<typename InputIterator >
void deleteEdge (GraphData &g, InputIterator first, InputIterator last)
 
template<typename InputIterator >
void deleteNode (GraphData &g, InputIterator first, InputIterator last)
 
template<typename T >
ostream & operator<< (ostream &os, const NodeElement< T > &nodeElement)
 
std::size_t hash_value (Diades::Graph::Node const &node)
 
template<typename T , typename ForwardIterator >
ForwardIterator initValueNodeMap (NodeMap< T > &map, ForwardIterator start, ForwardIterator end, typename NodeMap< T >::ConstReference value)
 
template<typename T >
void printDot (ostream &os, const T &value)
 
void mappedCopy (const Graph &graph, Graph &copy, ConstNodeMap< Node > &nodeMap, NodeMap< Node > &nodeMapCopy, ConstEdgeMap< Edge > &edgeMap, EdgeMap< Edge > &edgeMapCopy)
 
void mappedAppend (const Graph &graph, Graph &result, ConstNodeMap< Node > &nodeMap, NodeMap< Node > &nodeMapCopy, ConstEdgeMap< Edge > &edgeMap, EdgeMap< Edge > &edgeMapCopy)
 
template<>
void printDot< Diades::Automata::SubConfiguration > (ostream &os, const Diades::Automata::SubConfiguration &subConf)
 

Detailed Description

Namespace of the Graph library (libGraph)

This namespace contains the classes for the Graph. This library is a very basic implementation of graph structure. A Graph implements a directed graph structure. This Graph is composed of states (State) and edges (Edge). A State implements the notion of node of the Graph and a Edge implements the notion of edge of the Graph. In order to add some information to a State, you have to use a StateMap. To add an information to a Edge, you have to use a EdgeMap. A State object is a small object so it can be used like a reference (the real data of the State are in StateData). A Edge object can also be used like a reference (the real data of the EdgeData).

A few graph algorithms have been implemented in the library (Tremaux, and Tarjan)

Here is an example how to use the Graph library:

Node s1 = g.newNode();
Node s2 = g.newNode();
Edge t = g.newEdge(s1,s2);
NodeMap<int> index(g);
EdgeMap<string> label(g);
index[s1]=1;
index[s2]=2;
label[t]="a";
for(EdgeIterator it = g.beginOfEdge(); it != g.endOfEdge(); ++it) {
cout << index[it->source()] << label[*it] << index[it->target()] << endl;
}

Typedef Documentation

◆ EdgeIterator

typedef GraphIterator<Edge> Diades::Graph::EdgeIterator

EdgeIterator is a GraphIterator<Edge>

Definition at line 143 of file GraphInt.hh.

◆ InEdgeIterator

typedef list<Edge>::iterator Diades::Graph::InEdgeIterator

Definition at line 313 of file Edge.hh.

◆ LocalEdgeIterator

typedef list<Edge>::iterator Diades::Graph::LocalEdgeIterator

Definition at line 315 of file Edge.hh.

◆ NodeIterator

typedef GraphIterator<Node> Diades::Graph::NodeIterator

NodeIterator is a GraphIterator<Node>

Definition at line 139 of file GraphInt.hh.

◆ OutEdgeIterator

typedef list<Edge>::iterator Diades::Graph::OutEdgeIterator

Definition at line 314 of file Edge.hh.

Function Documentation

◆ deleteEdge() [1/2]

template<typename InputIterator >
void Diades::Graph::deleteEdge ( Graph g,
InputIterator  first,
InputIterator  last 
)
inline

Deletion of Edge

Parameters
gthe Graph
firstthe first element in the range to delete in the Graph g
lastthe first element after the last one to delete in the range

Some STL-like algorithms on Graph and GraphData

Definition at line 701 of file GraphInt.hh.

◆ deleteEdge() [2/2]

template<typename InputIterator >
void Diades::Graph::deleteEdge ( GraphData &  g,
InputIterator  first,
InputIterator  last 
)
inline

Definition at line 849 of file GraphIntOld.hh.

References Diades::Graph::Graph::deleteNode().

◆ deleteNode() [1/3]

template<typename InputIterator >
void Diades::Graph::deleteNode ( Graph g,
InputIterator  first,
InputIterator  last 
)
inline

Deletion of Node

Parameters
gthe Graph
firstthe first element in the range to delete in the Graph g
lastthe first element after the last one to delete in the range

Definition at line 714 of file GraphInt.hh.

◆ deleteNode() [2/3]

template<typename InputIterator , typename Predicate >
void Diades::Graph::deleteNode ( Graph g,
InputIterator  first,
InputIterator  last,
Predicate  pred 
)
inline
Parameters
gthe Graph
firstthe first element in the range to delete in the Graph g
lastlast the first element after the last one to delete in the range
predthe predicate that is true for any deleted transitions of the range and false for the transitions that are not deleted.

Definition at line 729 of file GraphInt.hh.

◆ deleteNode() [3/3]

template<typename InputIterator >
void Diades::Graph::deleteNode ( GraphData &  g,
InputIterator  first,
InputIterator  last 
)
inline

Definition at line 868 of file GraphIntOld.hh.

References Diades::Graph::Graph::deleteNode().

◆ hash_value() [1/2]

std::size_t Diades::Graph::hash_value ( Diades::Graph::Edge const &  e)
inline

boost::hash_value of an Edge

Parameters
edgethe Edge to hash
Returns
the hash value of an Edge (compatible with boost::hash, boost::hash_range, boost::hash_combine)

Definition at line 324 of file Edge.hh.

References Diades::Graph::Edge::id(), and Diades::Graph::Edge::valid().

Referenced by std::hash< boost::dynamic_bitset< Block, Alloc > >::operator()(), std::hash< Diades::Graph::Edge >::operator()(), and std::hash< Diades::Graph::Node >::operator()().

◆ hash_value() [2/2]

std::size_t Diades::Graph::hash_value ( Diades::Graph::Node const &  node)
inline

boost::hash_value of a Node

Parameters
nodethe Node to hash
Returns
the hash value of a Node (compatible with boost::hash, boost::hash_range, boost::hash_combine)

Definition at line 341 of file Node.hh.

References Diades::Graph::Node::id(), and Diades::Graph::Node::valid().

◆ initValue()

template<typename InputIterator , typename T >
InputIterator Diades::Graph::initValue ( EdgeMap< T > &  map,
InputIterator  start,
InputIterator  end,
typename EdgeMap< T >::ConstReference  value 
)

Definition at line 365 of file EdgeMap.hh.

References start.

◆ initValueConstEdgeMap()

template<typename T , typename ForwardIterator >
ForwardIterator Diades::Graph::initValueConstEdgeMap ( ConstEdgeMap< T > &  map,
ForwardIterator  start,
ForwardIterator  end,
typename ConstEdgeMap< T >::ConstReference  value 
)

Definition at line 363 of file ConstEdgeMap.hh.

References start.

◆ initValueConstNodeMap()

template<typename T , typename ForwardIterator >
ForwardIterator Diades::Graph::initValueConstNodeMap ( ConstNodeMap< T > &  map,
ForwardIterator  start,
ForwardIterator  end,
typename ConstNodeMap< T >::ConstReference  value 
)

Definition at line 355 of file ConstNodeMap.hh.

References start.

◆ initValueNodeMap()

template<typename T , typename ForwardIterator >
ForwardIterator Diades::Graph::initValueNodeMap ( NodeMap< T > &  map,
ForwardIterator  start,
ForwardIterator  end,
typename NodeMap< T >::ConstReference  value 
)

Definition at line 363 of file NodeMap.hh.

References start.

◆ mappedAppend()

void Diades::Graph::mappedAppend ( const Graph graph,
Graph result,
ConstNodeMap< Node > &  nodeMap,
NodeMap< Node > &  nodeMapCopy,
ConstEdgeMap< Edge > &  edgeMap,
EdgeMap< Edge > &  edgeMapCopy 
)

Graph appending with map recording

Parameters
graphthe Graph to copy
resultthe graph resulting from the appending of 'graph' with itself
nodeMapthe node mapping: graph's node -> copy's node
nodeMapCopythe node mapping: copy's node -> graph's node
edgeMapthe edge mapping: graph's edge -> copy's edge
edgeMapCopythe edge mapping: copy's edge -> graph's edge
Precondition
graph and result must be different

◆ mappedCopy()

void Diades::Graph::mappedCopy ( const Graph graph,
Graph copy,
ConstNodeMap< Node > &  nodeMap,
NodeMap< Node > &  nodeMapCopy,
ConstEdgeMap< Edge > &  edgeMap,
EdgeMap< Edge > &  edgeMapCopy 
)

Graph copy with map recording

Parameters
graphthe Graph to copy
copythe resulting copy of the graph
nodeMapthe node mapping: graph's node -> copy's node
nodeMapCopythe node mapping: copy's node -> graph's node
edgeMapthe edge mapping: graph's edge -> copy's edge
edgeMapCopythe edge mapping: copy's edge -> graph's edge
Precondition
graph and result must be different

◆ operator<<()

template<typename T >
ostream& Diades::Graph::operator<< ( ostream &  os,
const NodeElement< T > &  nodeElement 
)
inline

output stream operator on a NodeElement

Definition at line 202 of file GraphNodeSetTable.hh.

References Diades::Graph::NodeElement< T >::node().

◆ printDot()

template<typename T >
void Diades::Graph::printDot ( ostream &  os,
const T &  value 
)

◆ printDot< Diades::Automata::SubConfiguration >()

template<>
void Diades::Graph::printDot< Diades::Automata::SubConfiguration > ( ostream &  os,
const Diades::Automata::SubConfiguration subConf 
)
inline

Definition at line 386 of file SubConfiguration.hh.