aGrUM  0.13.2
gum::prm::gspan::EdgeCode Class Reference

represent a DFS code used by gspan. More...

#include <agrum/PRM/gspan/edgeCode.h>

Public Attributes

NodeId i
 The DFS subscript of the first node in the code. More...
 
NodeId j
 The DFS subscript of the second node in the code. More...
 
Size l_i
 The label of the first node in the code. More...
 
Size l_ij
 The label of the edge in the code. More...
 
Size l_j
 The label of the second node in the code. More...
 
std::string name
 The string version of this EdgeCode. More...
 

Public Member Functions

 EdgeCode (NodeId i, NodeId j, Size l_i, Size l_ij, Size l_j)
 Default constructor. More...
 
 EdgeCode (const EdgeCode &source)
 Copy constructor. More...
 
 ~EdgeCode ()
 Destructor. More...
 
bool isForward () const
 Returns true if this EdgeCode is a forward edge. More...
 
bool isBackward () const
 Returns true if this EdgeCode is a backward edge. More...
 
EdgeCodeoperator= (const EdgeCode &source)
 Copy operator. More...
 
bool operator== (const EdgeCode &code) const
 Equality operator. More...
 
bool operator!= (const EdgeCode &code) const
 Difference operator. More...
 
bool operator< (const EdgeCode &code) const
 Lesser than operator. More...
 

Detailed Description

represent a DFS code used by gspan.

A DFS code represents a pair of node and an edge between these two nodes.

Definition at line 49 of file edgeCode.h.

Constructor & Destructor Documentation

INLINE gum::prm::gspan::EdgeCode::EdgeCode ( NodeId  i,
NodeId  j,
Size  l_i,
Size  l_ij,
Size  l_j 
)

Default constructor.

If flag is true then this EdgeCode is a forward edge, otherwise it is a backward edge.

Parameters
iThe DFS subscript of the first node in the code.
jThe DFS subscript of the second node in the code.
l_iThe label of the first node in the code.
l_ijThe label of the edge in the code.
l_jThe label of the second node in the code.

Definition at line 32 of file edgeCode_inl.h.

References i, j, l_i, l_ij, l_j, and name.

33  :
34  i(my_i),
35  j(my_j), l_i(my_l_i), l_ij(my_l_ij), l_j(my_l_j) {
36  GUM_CONSTRUCTOR(EdgeCode);
37  std::stringstream sBuff;
38  sBuff << i << j << l_i << l_ij << l_j;
39  name = sBuff.str();
40  }
NodeId i
The DFS subscript of the first node in the code.
Definition: edgeCode.h:74
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
std::string name
The string version of this EdgeCode.
Definition: edgeCode.h:89
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
Size l_i
The label of the first node in the code.
Definition: edgeCode.h:80
INLINE gum::prm::gspan::EdgeCode::EdgeCode ( const EdgeCode source)

Copy constructor.

Parameters
sourceThe copied EdgeCode.

Definition at line 43 of file edgeCode_inl.h.

43  :
44  i(source.i), j(source.j), l_i(source.l_i), l_ij(source.l_ij),
45  l_j(source.l_j), name(source.name) {
46  GUM_CONS_CPY(EdgeCode);
47  }
NodeId i
The DFS subscript of the first node in the code.
Definition: edgeCode.h:74
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
std::string name
The string version of this EdgeCode.
Definition: edgeCode.h:89
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
Size l_i
The label of the first node in the code.
Definition: edgeCode.h:80
INLINE gum::prm::gspan::EdgeCode::~EdgeCode ( )

Destructor.

Definition at line 50 of file edgeCode_inl.h.

50 { GUM_DESTRUCTOR(EdgeCode); }
EdgeCode(NodeId i, NodeId j, Size l_i, Size l_ij, Size l_j)
Default constructor.
Definition: edgeCode_inl.h:32

Member Function Documentation

INLINE bool gum::prm::gspan::EdgeCode::isBackward ( ) const

Returns true if this EdgeCode is a backward edge.

Returns
Returns true if this EdgeCode is a backward edge.

Definition at line 56 of file edgeCode_inl.h.

References i, and j.

Referenced by gum::prm::gspan::DFSTree< GUM_SCALAR >::__checkGrowth(), gum::prm::gspan::DFSCode::operator<(), and gum::prm::gspan::DFSCode::validNeighbors().

56 { return i > j; }
NodeId i
The DFS subscript of the first node in the code.
Definition: edgeCode.h:74
NodeId j
The DFS subscript of the second node in the code.
Definition: edgeCode.h:77

+ Here is the caller graph for this function:

INLINE bool gum::prm::gspan::EdgeCode::isForward ( ) const

Returns true if this EdgeCode is a forward edge.

Returns
Returns true if this EdgeCode is a forward edge.

Definition at line 53 of file edgeCode_inl.h.

References i, and j.

Referenced by gum::prm::gspan::DFSCode::operator<(), gum::prm::gspan::Pattern::pop_back(), and gum::prm::gspan::DFSCode::validNeighbors().

53 { return i < j; }
NodeId i
The DFS subscript of the first node in the code.
Definition: edgeCode.h:74
NodeId j
The DFS subscript of the second node in the code.
Definition: edgeCode.h:77

+ Here is the caller graph for this function:

INLINE bool gum::prm::gspan::EdgeCode::operator!= ( const EdgeCode code) const

Difference operator.

Parameters
codeThe code tested for difference with this.
Returns
Returns true if this and code are different.

Definition at line 75 of file edgeCode_inl.h.

References i, j, l_i, l_ij, and l_j.

75  {
76  return ((i != code.i) || (j != code.j) || (l_i != code.l_i)
77  || (l_ij != code.l_ij) || (l_j != code.l_j));
78  }
NodeId i
The DFS subscript of the first node in the code.
Definition: edgeCode.h:74
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
Size l_j
The label of the second node in the code.
Definition: edgeCode.h:86
Size l_i
The label of the first node in the code.
Definition: edgeCode.h:80
INLINE bool gum::prm::gspan::EdgeCode::operator< ( const EdgeCode code) const

Lesser than operator.

Parameters
codeThe code on which the test is made.
Returns
Returns true if this is lesser than code.

Definition at line 81 of file edgeCode_inl.h.

References i, j, l_i, l_ij, and l_j.

81  {
82  if ((i == code.i) && (j == code.j)) {
83  return (l_i < code.l_i) || ((l_i == code.l_i) && (l_ij < code.l_ij))
84  || ((l_i == code.l_i) && (l_ij == code.l_ij) && (l_j < code.l_j));
85  } else {
86  return ((i == code.i) && (j < code.j))
87  || ((i < code.j) && (j == code.i));
88  }
89  }
NodeId i
The DFS subscript of the first node in the code.
Definition: edgeCode.h:74
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
Size l_j
The label of the second node in the code.
Definition: edgeCode.h:86
Size l_i
The label of the first node in the code.
Definition: edgeCode.h:80
INLINE EdgeCode & gum::prm::gspan::EdgeCode::operator= ( const EdgeCode source)

Copy operator.

Parameters
sourceThe copied EdgeCode.
Returns
Returns *this after the copy.

Definition at line 59 of file edgeCode_inl.h.

References i, j, l_i, l_ij, and l_j.

59  {
60  i = source.i;
61  j = source.j;
62  l_i = source.l_i;
63  l_ij = source.l_ij;
64  l_j = source.l_j;
65  return *this;
66  }
NodeId i
The DFS subscript of the first node in the code.
Definition: edgeCode.h:74
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
Size l_j
The label of the second node in the code.
Definition: edgeCode.h:86
Size l_i
The label of the first node in the code.
Definition: edgeCode.h:80
INLINE bool gum::prm::gspan::EdgeCode::operator== ( const EdgeCode code) const

Equality operator.

Parameters
codeThe code tested for equality with this.
Returns
Returns true if this and code are equal.

Definition at line 69 of file edgeCode_inl.h.

References i, j, l_i, l_ij, and l_j.

69  {
70  return ((i == code.i) && (j == code.j) && (l_i == code.l_i)
71  && (l_ij == code.l_ij) && (l_j == code.l_j));
72  }
NodeId i
The DFS subscript of the first node in the code.
Definition: edgeCode.h:74
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
Size l_j
The label of the second node in the code.
Definition: edgeCode.h:86
Size l_i
The label of the first node in the code.
Definition: edgeCode.h:80

Member Data Documentation

Size gum::prm::gspan::EdgeCode::l_i

The label of the first node in the code.

Definition at line 80 of file edgeCode.h.

Referenced by EdgeCode(), operator!=(), gum::prm::gspan::DFSCode::operator<(), operator<(), gum::prm::gspan::operator<<(), operator=(), and operator==().

Size gum::prm::gspan::EdgeCode::l_ij

The label of the edge in the code.

Definition at line 83 of file edgeCode.h.

Referenced by EdgeCode(), operator!=(), gum::prm::gspan::DFSCode::operator<(), operator<(), gum::prm::gspan::operator<<(), operator=(), and operator==().

Size gum::prm::gspan::EdgeCode::l_j

The label of the second node in the code.

Definition at line 86 of file edgeCode.h.

Referenced by EdgeCode(), operator!=(), gum::prm::gspan::DFSCode::operator<(), operator<(), gum::prm::gspan::operator<<(), operator=(), and operator==().

std::string gum::prm::gspan::EdgeCode::name

The string version of this EdgeCode.

Definition at line 89 of file edgeCode.h.

Referenced by EdgeCode().


The documentation for this class was generated from the following files: