aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
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 51 of file edgeCode.h.

Constructor & Destructor Documentation

◆ EdgeCode() [1/2]

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 34 of file edgeCode_inl.h.

References gum::prm::gspan::operator<<().

34  :
35  i(my_i), 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:76
NodeId j
The DFS subscript of the second node in the code.
Definition: edgeCode.h:79
Size l_ij
The label of the edge in the code.
Definition: edgeCode.h:85
std::string name
The string version of this EdgeCode.
Definition: edgeCode.h:91
EdgeCode(NodeId i, NodeId j, Size l_i, Size l_ij, Size l_j)
Default constructor.
Definition: edgeCode_inl.h:34
Size l_j
The label of the second node in the code.
Definition: edgeCode.h:88
Size l_i
The label of the first node in the code.
Definition: edgeCode.h:82
+ Here is the call graph for this function:

◆ EdgeCode() [2/2]

INLINE gum::prm::gspan::EdgeCode::EdgeCode ( const EdgeCode source)

Copy constructor.

Parameters
sourceThe copied EdgeCode.

Definition at line 43 of file edgeCode_inl.h.

References gum::prm::gspan::operator<<().

43  :
44  i(source.i), j(source.j), l_i(source.l_i), l_ij(source.l_ij), l_j(source.l_j),
45  name(source.name) {
46  GUM_CONS_CPY(EdgeCode);
47  }
NodeId i
The DFS subscript of the first node in the code.
Definition: edgeCode.h:76
NodeId j
The DFS subscript of the second node in the code.
Definition: edgeCode.h:79
Size l_ij
The label of the edge in the code.
Definition: edgeCode.h:85
std::string name
The string version of this EdgeCode.
Definition: edgeCode.h:91
EdgeCode(NodeId i, NodeId j, Size l_i, Size l_ij, Size l_j)
Default constructor.
Definition: edgeCode_inl.h:34
Size l_j
The label of the second node in the code.
Definition: edgeCode.h:88
Size l_i
The label of the first node in the code.
Definition: edgeCode.h:82
+ Here is the call graph for this function:

◆ ~EdgeCode()

INLINE gum::prm::gspan::EdgeCode::~EdgeCode ( )

Destructor.

Definition at line 49 of file edgeCode_inl.h.

References gum::prm::gspan::operator<<().

49  {
50  GUM_DESTRUCTOR(EdgeCode);
51  ;
52  }
EdgeCode(NodeId i, NodeId j, Size l_i, Size l_ij, Size l_j)
Default constructor.
Definition: edgeCode_inl.h:34
+ Here is the call graph for this function:

Member Function Documentation

◆ isBackward()

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 58 of file edgeCode_inl.h.

References gum::prm::gspan::operator<<().

58 { return i > j; }
NodeId i
The DFS subscript of the first node in the code.
Definition: edgeCode.h:76
NodeId j
The DFS subscript of the second node in the code.
Definition: edgeCode.h:79
+ Here is the call graph for this function:

◆ isForward()

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 55 of file edgeCode_inl.h.

References gum::prm::gspan::operator<<().

55 { return i < j; }
NodeId i
The DFS subscript of the first node in the code.
Definition: edgeCode.h:76
NodeId j
The DFS subscript of the second node in the code.
Definition: edgeCode.h:79
+ Here is the call graph for this function:

◆ operator!=()

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 77 of file edgeCode_inl.h.

References gum::prm::gspan::operator<<().

77  {
78  return ((i != code.i) || (j != code.j) || (l_i != code.l_i) || (l_ij != code.l_ij)
79  || (l_j != code.l_j));
80  }
NodeId i
The DFS subscript of the first node in the code.
Definition: edgeCode.h:76
NodeId j
The DFS subscript of the second node in the code.
Definition: edgeCode.h:79
Size l_ij
The label of the edge in the code.
Definition: edgeCode.h:85
Size l_j
The label of the second node in the code.
Definition: edgeCode.h:88
Size l_i
The label of the first node in the code.
Definition: edgeCode.h:82
+ Here is the call graph for this function:

◆ operator<()

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 83 of file edgeCode_inl.h.

References gum::prm::gspan::operator<<().

83  {
84  if ((i == code.i) && (j == code.j)) {
85  return (l_i < code.l_i) || ((l_i == code.l_i) && (l_ij < code.l_ij))
86  || ((l_i == code.l_i) && (l_ij == code.l_ij) && (l_j < code.l_j));
87  } else {
88  return ((i == code.i) && (j < code.j)) || ((i < code.j) && (j == code.i));
89  }
90  }
NodeId i
The DFS subscript of the first node in the code.
Definition: edgeCode.h:76
NodeId j
The DFS subscript of the second node in the code.
Definition: edgeCode.h:79
Size l_ij
The label of the edge in the code.
Definition: edgeCode.h:85
Size l_j
The label of the second node in the code.
Definition: edgeCode.h:88
Size l_i
The label of the first node in the code.
Definition: edgeCode.h:82
+ Here is the call graph for this function:

◆ operator=()

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 61 of file edgeCode_inl.h.

References gum::prm::gspan::operator<<().

61  {
62  i = source.i;
63  j = source.j;
64  l_i = source.l_i;
65  l_ij = source.l_ij;
66  l_j = source.l_j;
67  return *this;
68  }
NodeId i
The DFS subscript of the first node in the code.
Definition: edgeCode.h:76
NodeId j
The DFS subscript of the second node in the code.
Definition: edgeCode.h:79
Size l_ij
The label of the edge in the code.
Definition: edgeCode.h:85
Size l_j
The label of the second node in the code.
Definition: edgeCode.h:88
Size l_i
The label of the first node in the code.
Definition: edgeCode.h:82
+ Here is the call graph for this function:

◆ operator==()

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 71 of file edgeCode_inl.h.

References gum::prm::gspan::operator<<().

71  {
72  return ((i == code.i) && (j == code.j) && (l_i == code.l_i) && (l_ij == code.l_ij)
73  && (l_j == code.l_j));
74  }
NodeId i
The DFS subscript of the first node in the code.
Definition: edgeCode.h:76
NodeId j
The DFS subscript of the second node in the code.
Definition: edgeCode.h:79
Size l_ij
The label of the edge in the code.
Definition: edgeCode.h:85
Size l_j
The label of the second node in the code.
Definition: edgeCode.h:88
Size l_i
The label of the first node in the code.
Definition: edgeCode.h:82
+ Here is the call graph for this function:

Member Data Documentation

◆ i

NodeId gum::prm::gspan::EdgeCode::i

The DFS subscript of the first node in the code.

Definition at line 76 of file edgeCode.h.

◆ j

NodeId gum::prm::gspan::EdgeCode::j

The DFS subscript of the second node in the code.

Definition at line 79 of file edgeCode.h.

◆ l_i

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

The label of the first node in the code.

Definition at line 82 of file edgeCode.h.

◆ l_ij

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

The label of the edge in the code.

Definition at line 85 of file edgeCode.h.

◆ l_j

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

The label of the second node in the code.

Definition at line 88 of file edgeCode.h.

◆ name

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

The string version of this EdgeCode.

Definition at line 91 of file edgeCode.h.


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