aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
BNLearnerListener.cpp
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
<one line to give the program's name and a brief idea of what it does.>
23
Copyright (c) 2012 Pierre-Henri WUILLEMIN(@LIP6)
24
<pierre-henri.wuillemin@lip6.fr>
25
26
This program is free software: you can redistribute it and/or modify
27
it under the terms of the GNU General Public License as published by
28
the Free Software Foundation, either version 3 of the License, or
29
(at your option) any later version.
30
s
31
This program is distributed in the hope that it will be useful,
32
but WITHOUT ANY WARRANTY; without even the implied warranty of
33
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34
GNU General Public License for more details.
35
36
You should have received a copy of the GNU General Public License
37
along with this program. If not, see <http://www.gnu.org/licenses/>.
38
*/
39
40
#
include
<
agrum
/
BN
/
learning
/
BNLearnUtils
/
BNLearnerListener
.
h
>
41
#
include
<
agrum
/
BN
/
learning
/
BNLearnUtils
/
genericBNLearner
.
h
>
42
43
namespace
gum
{
44
namespace
learning
{
45
BNLearnerListener
::
BNLearnerListener
(
genericBNLearner
*
bnl
,
ApproximationScheme
&
sch
) :
46
ApproximationSchemeListener
(
sch
),
_bnlearner_
(
bnl
) {
47
bnl
->
setCurrentApproximationScheme
(&
sch
);
48
GUM_CONSTRUCTOR
(
BNLearnerListener
);
49
}
50
51
BNLearnerListener
::
BNLearnerListener
(
const
BNLearnerListener
&
other
) :
52
ApproximationSchemeListener
(
other
) {
53
GUM_CONS_CPY
(
BNLearnerListener
);
54
GUM_ERROR
(
OperationNotAllowed
,
"No copy constructor for BNLearnerListener"
)
55
}
56
57
BNLearnerListener
::~
BNLearnerListener
() {
58
GUM_DESTRUCTOR
(
BNLearnerListener
);
59
;
60
}
61
62
BNLearnerListener
&
BNLearnerListener
::
operator
=(
const
BNLearnerListener
&
other
) {
63
GUM_CONS_CPY
(
BNLearnerListener
);
64
GUM_ERROR
(
OperationNotAllowed
,
"No copy constructor for BNLearnerListener"
)
65
}
66
67
void
68
BNLearnerListener
::
whenProgress
(
const
void
*
src
,
Size
pourcent
,
double
error
,
double
time
) {
69
_bnlearner_
->
distributeProgress
(
static_cast
<
const
ApproximationScheme
* >(
src
),
70
pourcent
,
71
error
,
72
time
);
73
}
74
void
BNLearnerListener
::
whenStop
(
const
void
*
src
,
std
::
string
message
) {
75
_bnlearner_
->
distributeStop
(
static_cast
<
const
ApproximationScheme
* >(
src
),
message
);
76
}
77
}
// namespace learning
78
}
// namespace gum
gum::Set::emplace
INLINE void emplace(Args &&... args)
Definition:
set_tpl.h:643
gum::learning::genericBNLearner::Database::Database
Database(const std::string &filename, const BayesNet< GUM_SCALAR > &bn, const std::vector< std::string > &missing_symbols)
Definition:
genericBNLearner_tpl.h:31