main page
namespaces
classes
files
GGL home
Generated on Wed Apr 29 2015 11:51:40 for GGL-4.1.2 by
doxygen
1.8.3.1
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
src
ggl
Graph.hh
Go to the documentation of this file.
1
#ifndef GGL_GRAPH_HH_
2
#define GGL_GRAPH_HH_
3
4
#include <boost/graph/properties.hpp>
5
#include <boost/graph/adjacency_list.hpp>
6
7
#include <iostream>
8
#include <vector>
9
#include <set>
10
11
#include "
sgm/Graph_boost.hh
"
12
13
14
//! The ggl namespace contains classes needed to specify rules of a graph
15
//! grammar and to apply these rules to graphs.
16
namespace
ggl {
17
18
19
//! This boost graph property is used to determine the index of a given
20
//! node along the iterator order.
21
typedef
boost::vertex_index_t
PropNodeIndex
;
22
23
//! Vector of node indices
24
typedef
std::vector< PropNodeIndex >
NodeIndexVec
;
25
26
//! Set of node indices
27
typedef
std::set< PropNodeIndex >
NodeIndexSet
;
28
29
//! This boost graph property is used to determine the label of a given
30
//! node.
31
typedef
boost::vertex_name_t
PropNodeLabel
;
32
33
//! The properties available for the nodes of a Graph
34
//!
35
//! @author Martin Mann (c) 2008 http://www.bioinf.uni-freiburg.de/~mmann/
36
//!
37
typedef
boost::property<
PropNodeIndex
, size_t
38
, boost::property<
PropNodeLabel
, std::string
39
> >
40
Graph_NodeProperties
;
41
42
//! This boost graph property is used to determine the label of a given
43
//! edge.
44
typedef
boost::edge_name_t
PropEdgeLabel
;
45
46
//! The properties available for the edges of a Graph
47
//!
48
//! @author Martin Mann (c) 2008 http://www.bioinf.uni-freiburg.de/~mmann/
49
//!
50
typedef
boost::property<
PropEdgeLabel
, std::string
51
>
52
Graph_EdgeProperties
;
53
54
//! The definition of undirected graphs that are handled by the graph
55
//! grammar rules of the GGL.
56
//!
57
//! @author Martin Mann (c) 2008 http://www.bioinf.uni-freiburg.de/~mmann/
58
//!
59
typedef
boost::adjacency_list<
60
boost::vecS,
// store edges
61
boost::vecS,
// store vertices
62
boost::undirectedS,
// is an undirected graph
63
Graph_NodeProperties
,
// (atom symbols etc)
64
Graph_EdgeProperties
// (edge symbols etc)
65
>
66
Graph
;
67
68
69
/*!
70
* Definition of a sgm::Graph_Interface wrapper around a ggl::Graph
71
* object.
72
*
73
* @author Martin Mann (c) 2012 http://www.bioinf.uni-freiburg.de/~mmann/
74
*/
75
typedef
sgm::Graph_boost
<
Graph
\
76
,
PropNodeLabel
\
77
,
PropEdgeLabel
\
78
,
PropNodeIndex
\
79
>
Graph_boost
;
80
81
}
// namespace ggl
82
83
84
85
/*!
86
* Writes a ggl::Graph object to stream in GML format
87
* @param out the stream to write to
88
* @param g the graph to be written in GML format
89
* @return the changed input stream out
90
*/
91
std::ostream&
92
operator <<
( std::ostream & out,
const
ggl::Graph
& g );
93
94
95
#endif
/*GRAPH_HH_*/