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
sgm
PA_OrderCheck.hh
Go to the documentation of this file.
1
#ifndef SGM_PA_ORDERCHECK_HH_
2
#define SGM_PA_ORDERCHECK_HH_
3
4
5
#include <algorithm>
6
7
#include "
sgm/Pattern_Automorphism.hh
"
8
#include "
sgm/MR_Storing.hh
"
9
#include "
sgm/GM_vf2.hh
"
10
11
12
namespace
sgm {
13
14
15
/*! @brief Order based automorphism exclusion
16
*
17
* Performs an order check (e.g. "<") on match positions to identify
18
* symmetric matches.
19
*/
20
class
PA_OrderCheck
:
public
Pattern_Automorphism
{
21
public
:
22
23
//! pair of indices for order checking
24
typedef
std::pair<
Graph_Interface::IndexType
25
,
Graph_Interface::IndexType
>
IndexPair
;
26
//! list of Match positions to do an order check on
27
typedef
std::vector< IndexPair >
CheckList
;
28
29
protected
:
30
31
//! the source graph this automorphism description is defined for
32
const
Pattern_Interface
*
pattern
;
33
34
//! the list of Match positions to do an order check on
35
const
CheckList
checkList
;
36
37
public
:
38
39
/*! Construction of a graph symmetry handler.
40
* @param pattern the graph this Pattern_Automorphism handles
41
* @param checkList the list of order checks to apply to break all
42
* symmetries in the graph
43
*/
44
PA_OrderCheck
(
const
Pattern_Interface
&
pattern
45
,
const
CheckList
&
checkList
46
);
47
48
/*! Copy construction of a graph symmetry handler.
49
* @param toCopy the object to make this a copy of
50
*/
51
PA_OrderCheck
(
const
PA_OrderCheck
& toCopy );
52
53
//! Destruction
54
virtual
55
~PA_OrderCheck
();
56
57
/*!
58
* Checks whether or not the given match is symmetric to another match
59
* that is possible based on a list of order checks on the match.
60
*
61
* @param graph the graph the match belongs to
62
* @param match the match of the graph that has to be checked
63
* @return true if the match is a symmetric one, false otherwise
64
*/
65
bool
66
isSymmetryMatch
(
const
Pattern_Interface
& graph
67
,
const
Match
& match )
const
;
68
69
/*! Access to the internally used list of order checks applied in the
70
* symmetry check.
71
* @return the used CheckList
72
*/
73
const
CheckList
&
74
getCheckList
(
void
)
const
;
75
76
/*! Access to the graph this Pattern_Automorphism belongs to.
77
* @return the source graph
78
*/
79
const
Pattern_Interface
&
80
getPattern
(
void
)
const
;
81
82
/*! Creates a PA_OrderCheck object that handles all symmetries of a
83
* given graph. The template class specifies the GraphMatcher to
84
* be used.
85
*
86
* NOTE: PA_OrderCheck instances are only valid for patterns WITHOUT
87
* additional matching constraints. Thus, the method will return no
88
* checks for patterns including constraints!
89
*
90
* @param pattern the pattern graph of interest
91
* @return the Pattern_Automorphism breaking all symmetries of the graph
92
*/
93
template
<
class
GRAPHMATCHER >
94
static
95
PA_OrderCheck
96
getGraphAutomorphismT
(
const
Pattern_Interface
&
pattern
);
97
98
/*! Creates a PA_OrderCheck object that handles all symmetries of a
99
* given graph. Calls getGraphAutomorphismT< GM_vf2 >.
100
*
101
* NOTE: PA_OrderCheck instances are only valid for patterns WITHOUT
102
* additional matching constraints. Thus, the method will return no
103
* checks for patterns including constraints!
104
*
105
* @param pattern the pattern graph of interest
106
* @return the Pattern_Automorphism breaking all symmetries of the graph
107
*/
108
static
109
PA_OrderCheck
110
getGraphAutomorphism
(
const
Pattern_Interface
&
pattern
);
111
112
113
/*!
114
* Creates a new allocated copy of this object on heap. NOTE, the
115
* returned copy has to be deleted by the calling method.
116
*
117
* @return a copy of this
118
*/
119
virtual
120
PA_OrderCheck
*
121
clone
(
void
)
const
;
122
123
};
124
125
126
}
// namespace sgm
127
128
129
#include <ostream>
130
131
/*!
132
* Prints the list of order checks of a PA_OrderCheck object to stream.
133
*
134
* @param out the stream to write to
135
* @param pa the PA_OrderCheck object to write
136
* @return the modified stream
137
*/
138
std::ostream&
139
operator <<
( std::ostream& out,
const
sgm::PA_OrderCheck
& pa );
140
141
142
// include implementation
143
#include "sgm/PA_OrderCheck.icc"
144
145
#endif
/*SGM_PA_ORDERCHECK_HH_*/