aGrUM
3.2.0
a C++ library for (probabilistic) graphical models
Toggle main menu visibility
edgeGrowth.h
Go to the documentation of this file.
1
/****************************************************************************
2
* This file is part of the aGrUM/pyAgrum library. *
3
* *
4
* Copyright (c) 2005-2026 by *
5
* - Pierre-Henri WUILLEMIN(_at_LIP6) *
6
* - Christophe GONZALES(_at_AMU) *
7
* *
8
* The aGrUM/pyAgrum library is free software; you can redistribute it *
9
* and/or modify it under the terms of either : *
10
* *
11
* - the GNU Lesser General Public License as published by *
12
* the Free Software Foundation, either version 3 of the License, *
13
* or (at your option) any later version, *
14
* - the MIT license (MIT), *
15
* - or both in dual license, as here. *
16
* *
17
* (see https://agrum.gitlab.io/articles/dual-licenses-lgplv3mit.html) *
18
* *
19
* This aGrUM/pyAgrum library is distributed in the hope that it will be *
20
* useful, but WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
21
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES MERCHANTABILITY or FITNESS *
22
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
23
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
24
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
25
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR *
26
* OTHER DEALINGS IN THE SOFTWARE. *
27
* *
28
* See LICENCES for more details. *
29
* *
30
* SPDX-FileCopyrightText: Copyright 2005-2026 *
31
* - Pierre-Henri WUILLEMIN(_at_LIP6) *
32
* - Christophe GONZALES(_at_AMU) *
33
* SPDX-License-Identifier: LGPL-3.0-or-later OR MIT *
34
* *
35
* Contact : info_at_agrum_dot_org *
36
* homepage : http://agrum.gitlab.io *
37
* gitlab : https://gitlab.com/agrumery/agrum *
38
* *
39
****************************************************************************/
40
41
48
49
#ifndef GUM_EDGE_GROWTH_H
50
#define GUM_EDGE_GROWTH_H
51
52
#include <list>
53
#include <ostream>
54
#include <utility>
55
#include <vector>
56
57
#include <
agrum/base/graphs/algorithms/triangulations/partialOrderedTriangulation.h
>
58
#include <
agrum/PRM/gspan/pattern.h
>
59
60
namespace
gum
{
61
namespace
prm
{
62
namespace
gspan
{
63
template
< GUM_Numeric GUM_SCALAR >
64
class
DFSTree
;
65
72
template
< GUM_Numeric GUM_SCALAR >
73
class
EdgeGrowth
{
74
public
:
75
friend
class
DFSTree
< GUM_SCALAR >;
77
EdgeGrowth
(
NodeId
a_u,
LabelData
* an_edge,
LabelData
* a_l_v,
NodeId
a_v = 0);
79
EdgeGrowth
(
const
EdgeGrowth
& from);
81
~EdgeGrowth
();
83
NodeId
u
;
85
LabelData
*
edge
;
87
LabelData
*
l_v
;
90
NodeId
v
;
92
void
insert
(
PRMInstance< GUM_SCALAR >
*
u
,
PRMInstance< GUM_SCALAR >
*
v
);
95
NodeProperty< std::pair< PRMInstance< GUM_SCALAR >
*,
PRMInstance< GUM_SCALAR >
* > >
matches
;
97
std::string
toString
();
98
99
private
:
101
UndiGraph
iso_graph
;
103
std::vector< NodeId >*
degree_list
;
105
Set< NodeId >
max_indep_set
;
106
};
107
108
template
< GUM_Numeric GUM_SCALAR >
109
std::ostream&
operator<<
(std::ostream& out,
const
EdgeGrowth< GUM_SCALAR >
& edge);
110
111
112
#ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
113
extern
template
class
EdgeGrowth< double >
;
114
#endif
115
116
117
}
/* namespace gspan */
118
}
/* namespace prm */
119
}
/* namespace gum */
120
121
#include <
agrum/PRM/gspan/edgeGrowth_tpl.h
>
122
123
#endif
/* GUM_EDGE_GROWTH_H */
gum::Set< NodeId >
gum::UndiGraph
Base class for undirected graphs.
Definition
undiGraph.h:130
gum::prm::PRMInstance
An PRMInstance is a Bayesian network fragment defined by a Class and used in a PRMSystem.
Definition
PRMInstance.h:79
gum::prm::gspan::DFSTree
A DFSTree is used by gspan to sort lexicographically patterns discovered in an interface graph.
Definition
DFSTree.h:77
gum::prm::gspan::EdgeGrowth
This class is used to define an edge growth of a pattern in this DFSTree.
Definition
edgeGrowth.h:73
gum::prm::gspan::EdgeGrowth::u
NodeId u
The id of the node from which we grow an edge.
Definition
edgeGrowth.h:83
gum::prm::gspan::EdgeGrowth::degree_list
std::vector< NodeId > * degree_list
Vector used for computation.
Definition
edgeGrowth.h:103
gum::prm::gspan::EdgeGrowth::matches
NodeProperty< std::pair< PRMInstance< GUM_SCALAR > *, PRMInstance< GUM_SCALAR > * > > matches
The mapping between the u and v for each match in the interface graph.
Definition
edgeGrowth.h:95
gum::prm::gspan::EdgeGrowth::max_indep_set
Set< NodeId > max_indep_set
The max indep set of matches.
Definition
edgeGrowth.h:105
gum::prm::gspan::EdgeGrowth::v
NodeId v
If the growth is backward you must assigned the subscript of v, otherwise 0 is assigned (recall that ...
Definition
edgeGrowth.h:90
gum::prm::gspan::EdgeGrowth::iso_graph
UndiGraph iso_graph
The iso graph for computing the maximum independent set of matches.
Definition
edgeGrowth.h:101
gum::prm::gspan::EdgeGrowth::EdgeGrowth
EdgeGrowth(NodeId a_u, LabelData *an_edge, LabelData *a_l_v, NodeId a_v=0)
Constructor.
Definition
edgeGrowth_tpl.h:58
gum::prm::gspan::EdgeGrowth::edge
LabelData * edge
The LabelData over the edge of this edge growth.
Definition
edgeGrowth.h:85
gum::prm::gspan::EdgeGrowth::l_v
LabelData * l_v
The LabelData over the node of this edge growth.
Definition
edgeGrowth.h:87
gum::prm::gspan::EdgeGrowth::toString
std::string toString()
Return a string representation of this.
Definition
edgeGrowth_tpl.h:83
gum::prm::gspan::EdgeGrowth::insert
void insert(PRMInstance< GUM_SCALAR > *u, PRMInstance< GUM_SCALAR > *v)
Add the pair (u,v) as a match for the current growth.
Definition
edgeGrowth_tpl.h:90
edgeGrowth_tpl.h
Inline implementation of the DFSTree class.
gum::NodeId
Size NodeId
Type for node ids.
Definition
graphElements.h:117
gum::NodeProperty
HashTable< NodeId, VAL > NodeProperty
Property on graph elements.
Definition
graphElements.h:407
gum::prm::gspan
Definition
DFSCode.cpp:57
gum::prm::gspan::operator<<
std::ostream & operator<<(std::ostream &out, const DFSCode &code)
Print code in out.
Definition
DFSCode.cpp:59
gum::prm
namespace for all probabilistic relational models entities
Definition
agrum.h:68
gum
gum is the global namespace for all aGrUM entities
Definition
agrum.h:46
partialOrderedTriangulation.h
class for graph triangulations for which we enforce a given partial ordering on the nodes elimination...
pattern.h
Headers of the Pattern class.
gum::prm::gspan::LabelData
Inner class to handle data about labels in this interface graph.
Definition
interfaceGraph.h:68
aGrUM
3.2.0
© PHW&CG&others - 2022
DoXyGeN 1.18.0