aGrUM
0.20.2
a C++ library for (probabilistic) graphical models
BNLearnerListener.cpp
Go to the documentation of this file.
1
/**
2
*
3
* Copyright 2005-2020 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
,
46
ApproximationScheme
&
sch
) :
47
ApproximationSchemeListener
(
sch
),
48
bnlearner__
(
bnl
) {
49
bnl
->
setCurrentApproximationScheme
(&
sch
);
50
GUM_CONSTRUCTOR
(
BNLearnerListener
);
51
}
52
53
BNLearnerListener
::
BNLearnerListener
(
const
BNLearnerListener
&
other
) :
54
ApproximationSchemeListener
(
other
) {
55
GUM_CONS_CPY
(
BNLearnerListener
);
56
GUM_ERROR
(
OperationNotAllowed
,
"No copy constructor for BNLearnerListener"
);
57
}
58
59
BNLearnerListener
::~
BNLearnerListener
() {
GUM_DESTRUCTOR
(
BNLearnerListener
); }
60
61
BNLearnerListener
&
62
BNLearnerListener
::
operator
=(
const
BNLearnerListener
&
other
) {
63
GUM_CONS_CPY
(
BNLearnerListener
);
64
GUM_ERROR
(
OperationNotAllowed
,
"No copy constructor for BNLearnerListener"
);
65
}
66
67
void
BNLearnerListener
::
whenProgress
(
const
void
*
src
,
68
Size
pourcent
,
69
double
error
,
70
double
time
) {
71
bnlearner__
->
distributeProgress
(
72
static_cast
<
const
ApproximationScheme
* >(
src
),
73
pourcent
,
74
error
,
75
time
);
76
}
77
void
BNLearnerListener
::
whenStop
(
const
void
*
src
,
std
::
string
message
) {
78
bnlearner__
->
distributeStop
(
static_cast
<
const
ApproximationScheme
* >(
src
),
79
message
);
80
}
81
}
// namespace learning
82
}
// namespace gum
gum::Set::emplace
INLINE void emplace(Args &&... args)
Definition:
set_tpl.h:669
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