aGrUM
0.21.0
a C++ library for (probabilistic) graphical models
UGmodel_inl.h
Go to the documentation of this file.
1
/**
2
*
3
* Copyright (c) 2005-2021 by Pierre-Henri WUILLEMIN(@LIP6) & Christophe GONZALES(@AMU)
4
* info_at_agrum_dot_org
5
*
6
* This library is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU Lesser General Public License as published by
8
* the Free Software Foundation, either version 3 of the License, or
9
* (at your option) any later version.
10
*
11
* This library is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU Lesser General Public License for more details.
15
*
16
* You should have received a copy of the GNU Lesser General Public License
17
* along with this library. If not, see <http://www.gnu.org/licenses/>.
18
*
19
*/
20
21
22
/**
23
* @file
24
* @brief Interface-like class encapsulating basic functionalities for a
25
*IMarkovNetwork.
26
*
27
* @author Pierre-Henri WUILLEMIN(@LIP6) & Christophe GONZALES(@AMU)
28
*/
29
30
#
include
<
agrum
/
tools
/
core
/
math
/
math_utils
.
h
>
31
#
include
<
agrum
/
tools
/
graphicalModels
/
UGmodel
.
h
>
32
33
namespace
gum
{
34
INLINE
35
const
UndiGraph
&
UGmodel
::
graph
()
const
{
return
graph_
; }
36
37
INLINE
38
Size
UGmodel
::
size
()
const
{
return
graph
().
size
(); }
39
40
INLINE
41
Size
UGmodel
::
sizeEdges
()
const
{
return
graph_
.
sizeEdges
(); }
42
43
INLINE
const
EdgeSet
&
UGmodel
::
edges
()
const
{
return
graph_
.
edges
(); }
44
45
INLINE
bool
UGmodel
::
existsEdge
(
const
NodeId
node1
,
const
NodeId
node2
)
const
{
46
return
graph_
.
existsEdge
(
node1
,
node2
);
47
}
48
49
INLINE
bool
UGmodel
::
existsEdge
(
const
std
::
string
&
name1
,
const
std
::
string
&
name2
)
const
{
50
return
existsEdge
(
idFromName
(
name1
),
idFromName
(
name2
));
51
}
52
53
INLINE
const
NodeSet
&
UGmodel
::
neighbours
(
const
NodeId
id
)
const
{
return
graph_
.
neighbours
(
id
); }
54
INLINE
const
NodeSet
&
UGmodel
::
neighbours
(
const
std
::
string
&
name
)
const
{
55
return
neighbours
(
idFromName
(
name
));
56
}
57
58
INLINE
bool
UGmodel
::
exists
(
NodeId
node
)
const
{
return
graph_
.
exists
(
node
); }
59
60
INLINE
const
NodeGraphPart
&
UGmodel
::
nodes
()
const
{
return
(
NodeGraphPart
&)
graph_
; }
61
62
INLINE
bool
UGmodel
::
isIndependent
(
NodeId
X
,
NodeId
Y
,
const
NodeSet
&
Z
)
const
{
63
return
!
graph
().
hasUndirectedPath
(
X
,
Y
,
Z
);
64
}
65
66
INLINE
bool
UGmodel
::
isIndependent
(
const
NodeSet
&
X
,
const
NodeSet
&
Y
,
const
NodeSet
&
Z
)
const
{
67
return
!
graph
().
hasUndirectedPath
(
X
,
Y
,
Z
);
68
}
69
70
}
/* namespace gum */
gum::Set::emplace
INLINE void emplace(Args &&... args)
Definition:
set_tpl.h:643