aGrUM  0.14.2
edgeCode.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Christophe GONZALES and Pierre-Henri WUILLEMIN *
3  * {prenom.nom}_at_lip6.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
26 #ifndef GUM_EDGE_CODE_H
27 #define GUM_EDGE_CODE_H
28 
29 #include <ostream>
30 
31 #include <agrum/agrum.h>
33 
34 namespace gum {
35 
36  namespace prm {
37 
38  namespace gspan {
39 
49  struct EdgeCode {
63 
68  EdgeCode(const EdgeCode& source);
69 
71  ~EdgeCode();
72 
75 
78 
81 
84 
87 
89  std::string name;
90 
95  bool isForward() const;
96 
101  bool isBackward() const;
102 
108  EdgeCode& operator=(const EdgeCode& source);
109 
115  bool operator==(const EdgeCode& code) const;
116 
122  bool operator!=(const EdgeCode& code) const;
123 
129  bool operator<(const EdgeCode& code) const;
130  };
131 
138  std::ostream& operator<<(std::ostream& out, const EdgeCode& code);
139 
140  } /* namespace gspan */
141  } /* namespace prm */
142 } /* namespace gum */
143 
144 #ifndef GUM_NO_INLINE
146 #endif // GUM_NO_INLINE
147 
148 #endif /* GUM_EDGE_CODE_H */
NodeId i
The DFS subscript of the first node in the code.
Definition: edgeCode.h:74
bool operator!=(const EdgeCode &code) const
Difference operator.
Definition: edgeCode_inl.h:75
std::ostream & operator<<(std::ostream &out, const DFSCode &code)
Print code in out.
Definition: DFSCode.cpp:37
NodeId j
The DFS subscript of the second node in the code.
Definition: edgeCode.h:77
Size l_ij
The label of the edge in the code.
Definition: edgeCode.h:83
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
represent a DFS code used by gspan.
Definition: edgeCode.h:49
bool isBackward() const
Returns true if this EdgeCode is a backward edge.
Definition: edgeCode_inl.h:56
bool operator<(const EdgeCode &code) const
Lesser than operator.
Definition: edgeCode_inl.h:81
bool operator==(const EdgeCode &code) const
Equality operator.
Definition: edgeCode_inl.h:69
std::string name
The string version of this EdgeCode.
Definition: edgeCode.h:89
Inline implementation of the EdgeCode class.
EdgeCode(NodeId i, NodeId j, Size l_i, Size l_ij, Size l_j)
Default constructor.
Definition: edgeCode_inl.h:32
Size l_j
The label of the second node in the code.
Definition: edgeCode.h:86
bool isForward() const
Returns true if this EdgeCode is a forward edge.
Definition: edgeCode_inl.h:53
EdgeCode & operator=(const EdgeCode &source)
Copy operator.
Definition: edgeCode_inl.h:59
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:45
Size NodeId
Type for node ids.
Definition: graphElements.h:97
some utils for topology : NodeId, Edge, Arc and consorts ...
Size l_i
The label of the first node in the code.
Definition: edgeCode.h:80