aGrUM 3.1.1
a C++ library for (probabilistic) graphical models
gum::prm::gspan Namespace Reference

Classes

class  DFSCode
 Reprensent a Depth First Search coding of a graph. More...
class  SearchStrategy
 This is an abstract class used to tune search strategies in the gspan algorithm. More...
class  DFSTree
 A DFSTree is used by gspan to sort lexicographically patterns discovered in an interface graph. More...
class  EdgeCode
 represent a DFS code used by gspan. More...
class  EdgeGrowth
 This class is used to define an edge growth of a pattern in this DFSTree. More...
struct  LabelData
 Inner class to handle data about labels in this interface graph. More...
struct  NodeData
 Inner class to handle data about nodes in graph. More...
struct  EdgeData
 Inner class to handle data about edges in graph. More...
class  InterfaceGraph
 This class represent the interface graph of a given gum::prm::PRMSystem<GUM_SCALAR>. More...
class  Pattern
 This contains all the information we want for a node in a DFSTree. More...
class  FrequenceSearch
 This is class is an implementation of a simple serach strategy for the gspan algorithm: it accept a growth if its frequency is above a user defined value. More...
class  StrictSearch
 This is class is an implementation of a strict strategy for the GSpan algorithm. More...
class  TreeWidthSearch
 A growth is accepted if and only if the new growth has a tree width less large or equal than its father. More...

Functions

std::ostream & operator<< (std::ostream &out, const DFSCode &code)
 Print code in out.
template<GUM_Numeric GUM_SCALAR>
std::ostream & operator<< (std::ostream &out, const EdgeGrowth< GUM_SCALAR > &edge)
std::ostream & operator<< (std::ostream &out, const EdgeCode &code)
 Print code in out.
std::ostream & operator<< (std::ostream &out, const LabelData &data)
 Print a LabelData in out.
template<GUM_Numeric GUM_SCALAR>
std::ostream & operator<< (std::ostream &out, const NodeData< GUM_SCALAR > &data)
 Print a NodeData<GUM_SCALAR> in out.
template<GUM_Numeric GUM_SCALAR>
std::ostream & operator<< (std::ostream &out, const EdgeData< GUM_SCALAR > &data)
 Print a EdgeData<GUM_SCALAR> in out.

Function Documentation

◆ operator<<() [1/6]

std::ostream & gum::prm::gspan::operator<< ( std::ostream & out,
const DFSCode & code )

Print code in out.

Parameters
outThe stream in which code is printed.
codeThe printed DFSCode.
Returns
Returns out after printing code in it.

Definition at line 59 of file DFSCode.cpp.

59 {
60 out << "[ ";
61 bool first = true;
62
63 for (const auto item: code.codes) {
64 if (!first) out << ", ";
65 out << *item;
66 first = false;
67 }
68
69 out << " ]";
70 return out;
71 }
std::vector< EdgeCode * > codes
The vector containing the EdgeCode composing this DFSCode.
Definition DFSCode.h:109

References gum::prm::gspan::DFSCode::codes.

◆ operator<<() [2/6]

std::ostream & gum::prm::gspan::operator<< ( std::ostream & out,
const EdgeCode & code )

Print code in out.

Parameters
outThe stream in which code is printed.
codeThe printed EdgeCode.
Returns
Returns out after printing code in it.

Definition at line 59 of file edgeCode.cpp.

59 {
60 out << "(" << code.i << ", " << code.j << ", " << code.l_i << ", ";
61 out << code.l_ij << ", " << code.l_j << ")";
62 return out;
63 }
Size l_i
The label of the first node in the code.
Definition edgeCode.h:103
NodeId i
The DFS subscript of the first node in the code.
Definition edgeCode.h:97
Size l_ij
The label of the edge in the code.
Definition edgeCode.h:106
NodeId j
The DFS subscript of the second node in the code.
Definition edgeCode.h:100
Size l_j
The label of the second node in the code.
Definition edgeCode.h:109

References gum::prm::gspan::EdgeCode::i, gum::prm::gspan::EdgeCode::j, gum::prm::gspan::EdgeCode::l_i, gum::prm::gspan::EdgeCode::l_ij, and gum::prm::gspan::EdgeCode::l_j.

◆ operator<<() [3/6]

template<GUM_Numeric GUM_SCALAR>
std::ostream & gum::prm::gspan::operator<< ( std::ostream & out,
const EdgeData< GUM_SCALAR > & data )

Print a EdgeData<GUM_SCALAR> in out.

Parameters
outThe stream in which data is printed.
dataThe data printed.
Returns
Returns out.

Definition at line 386 of file interfaceGraph_tpl.h.

386 {
387 out << data.u->name() << " -> " << data.v->name() << "(" << data.l->l << ")";
388 return out;
389 }
PRMInstance< GUM_SCALAR > * v
The other instance represented by thus edge.
PRMInstance< GUM_SCALAR > * u
One of the two instance represented by this edge.
LabelData * l
The labal data of this edge.
std::string l
The string version of this label.

References gum::prm::gspan::EdgeData< GUM_SCALAR >::l, gum::prm::gspan::LabelData::l, gum::prm::gspan::EdgeData< GUM_SCALAR >::u, and gum::prm::gspan::EdgeData< GUM_SCALAR >::v.

◆ operator<<() [4/6]

template<GUM_Numeric GUM_SCALAR>
std::ostream & gum::prm::gspan::operator<< ( std::ostream & out,
const EdgeGrowth< GUM_SCALAR > & edge )

Definition at line 482 of file DFSTree_tpl.h.

482 {
483 out << edge.u << ", " << *(edge.edge) << ", " << *(edge.l_v) << ", " << edge.v;
484 return out;
485 }
NodeId u
The id of the node from which we grow an edge.
Definition edgeGrowth.h:83
NodeId v
If the growth is backward you must assigned the subscript of v, otherwise 0 is assigned (recall that ...
Definition edgeGrowth.h:90
LabelData * edge
The LabelData over the edge of this edge growth.
Definition edgeGrowth.h:85
LabelData * l_v
The LabelData over the node of this edge growth.
Definition edgeGrowth.h:87

References gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::edge, gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::l_v, gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::u, and gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::v.

◆ operator<<() [5/6]

std::ostream & gum::prm::gspan::operator<< ( std::ostream & out,
const LabelData & data )

Print a LabelData in out.

Parameters
outThe stream in which data is printed.
dataThe data printed.
Returns
Returns out.

Definition at line 55 of file interfaceGraph.cpp.

55 {
56 out << data.l;
57 return out;
58 }

References gum::prm::gspan::LabelData::l.

◆ operator<<() [6/6]

template<GUM_Numeric GUM_SCALAR>
std::ostream & gum::prm::gspan::operator<< ( std::ostream & out,
const NodeData< GUM_SCALAR > & data )

Print a NodeData<GUM_SCALAR> in out.

Parameters
outThe stream in which data is printed.
dataThe data printed.
Returns
Returns out.

Definition at line 380 of file interfaceGraph_tpl.h.

380 {
381 out << data.n->name() << "(" << data.l->l << ")";
382 return out;
383 }
PRMInstance< GUM_SCALAR > * n
The instance represented by this node.
LabelData * l
The label of this node.

References gum::prm::gspan::LabelData::l, gum::prm::gspan::NodeData< GUM_SCALAR >::l, and gum::prm::gspan::NodeData< GUM_SCALAR >::n.