aGrUM
3.2.0
a C++ library for (probabilistic) graphical models
Toggle main menu visibility
IApproximationSchemeConfiguration.cpp
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
51
52
// To help IDE parsers
53
#include <
agrum/base/core/approximations/IApproximationSchemeConfiguration.h
>
54
55
namespace
gum
{
56
IApproximationSchemeConfiguration::IApproximationSchemeConfiguration
() {
57
GUM_CONSTRUCTOR(
IApproximationSchemeConfiguration
);
58
}
59
60
IApproximationSchemeConfiguration::~IApproximationSchemeConfiguration
() {
61
GUM_DESTRUCTOR(
IApproximationSchemeConfiguration
);
62
}
63
64
std::string
IApproximationSchemeConfiguration::messageApproximationScheme
()
const
{
65
switch
(
stateApproximationScheme
()) {
66
case
ApproximationSchemeSTATE::Continue
:
return
"in progress"
;
67
68
case
ApproximationSchemeSTATE::Epsilon
:
69
return
std::format(
"stopped with epsilon={}"
,
epsilon
());
70
71
case
ApproximationSchemeSTATE::Rate
:
72
return
std::format(
"stopped with rate={}"
,
minEpsilonRate
());
73
74
case
ApproximationSchemeSTATE::Limit
:
75
return
std::format(
"stopped with max iteration={}"
,
maxIter
());
76
77
case
ApproximationSchemeSTATE::TimeLimit
:
78
return
std::format(
"stopped with timeout={}"
,
maxTime
());
79
80
case
ApproximationSchemeSTATE::Stopped
:
return
"stopped on request"
;
81
82
case
ApproximationSchemeSTATE::Undefined
:
return
"undefined state"
;
83
}
84
return
{};
85
}
86
}
// namespace gum
87
88
#ifdef GUM_NO_INLINE
89
# include <
agrum/base/core/approximations/IApproximationSchemeConfiguration_inl.h
>
90
#endif
IApproximationSchemeConfiguration.h
This file contains getters and setters definition for ApproximationScheme settings.
IApproximationSchemeConfiguration_inl.h
This file contains getters and setters definition for ApproximationScheme settings.
gum::IApproximationSchemeConfiguration::epsilon
virtual double epsilon() const =0
Returns the value of epsilon.
gum::IApproximationSchemeConfiguration::~IApproximationSchemeConfiguration
virtual ~IApproximationSchemeConfiguration()
Class destructor.
Definition
IApproximationSchemeConfiguration.cpp:60
gum::IApproximationSchemeConfiguration::IApproximationSchemeConfiguration
IApproximationSchemeConfiguration()
Class constructors.
Definition
IApproximationSchemeConfiguration.cpp:56
gum::IApproximationSchemeConfiguration::ApproximationSchemeSTATE::TimeLimit
@ TimeLimit
Definition
IApproximationSchemeConfiguration.h:93
gum::IApproximationSchemeConfiguration::ApproximationSchemeSTATE::Limit
@ Limit
Definition
IApproximationSchemeConfiguration.h:92
gum::IApproximationSchemeConfiguration::ApproximationSchemeSTATE::Epsilon
@ Epsilon
Definition
IApproximationSchemeConfiguration.h:90
gum::IApproximationSchemeConfiguration::ApproximationSchemeSTATE::Continue
@ Continue
Definition
IApproximationSchemeConfiguration.h:89
gum::IApproximationSchemeConfiguration::ApproximationSchemeSTATE::Stopped
@ Stopped
Definition
IApproximationSchemeConfiguration.h:94
gum::IApproximationSchemeConfiguration::ApproximationSchemeSTATE::Rate
@ Rate
Definition
IApproximationSchemeConfiguration.h:91
gum::IApproximationSchemeConfiguration::ApproximationSchemeSTATE::Undefined
@ Undefined
Definition
IApproximationSchemeConfiguration.h:88
gum::IApproximationSchemeConfiguration::stateApproximationScheme
virtual ApproximationSchemeSTATE stateApproximationScheme() const =0
Returns the approximation scheme state.
gum::IApproximationSchemeConfiguration::minEpsilonRate
virtual double minEpsilonRate() const =0
Returns the value of the minimal epsilon rate.
gum::IApproximationSchemeConfiguration::messageApproximationScheme
std::string messageApproximationScheme() const
Returns the approximation scheme message.
Definition
IApproximationSchemeConfiguration.cpp:64
gum::IApproximationSchemeConfiguration::maxIter
virtual Size maxIter() const =0
Returns the criterion on number of iterations.
gum::IApproximationSchemeConfiguration::maxTime
virtual double maxTime() const =0
Returns the timeout (in seconds).
gum
gum is the global namespace for all aGrUM entities
Definition
agrum.h:46
aGrUM
3.2.0
© PHW&CG&others - 2022
DoXyGeN 1.18.0