aGrUM
3.2.0
a C++ library for (probabilistic) graphical models
Toggle main menu visibility
IScheduleMultiDim_inl.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
#pragma once
42
43
49
50
#include <
agrum/base/graphicalModels/inference/scheduler/IScheduleMultiDim.h
>
// to ease IDE parser
51
#ifndef DOXYGEN_SHOULD_SKIP_THIS
52
53
# include <sstream>
54
# include <string>
55
56
# include <
agrum/agrum.h
>
57
58
# include <
agrum/base/graphicalModels/inference/scheduler/IScheduleMultiDim.h
>
59
60
namespace
gum
{
61
63
INLINE
Idx
IScheduleMultiDim::_newId_
() {
return
++
_multidim_id_
; }
64
66
INLINE
void
IScheduleMultiDim::resetIdGenerator
() {
_multidim_id_
=
Idx
(0); }
67
69
INLINE
IScheduleMultiDim::IScheduleMultiDim
(
const
Idx
id
) :
70
id_(id ==
Idx
(0) ?
IScheduleMultiDim
::_newId_() : id) {
71
// make sure that we won't get several IScheduleMultiDim with the same Id
72
if
(id_ > _multidim_id_) _multidim_id_ = id_;
73
74
// for debugging purposes
75
GUM_CONSTRUCTOR(IScheduleMultiDim);
76
}
77
79
INLINE IScheduleMultiDim::IScheduleMultiDim(
const
IScheduleMultiDim& from) : id_(from.id_) {
80
// for debugging purposes
81
GUM_CONS_CPY(IScheduleMultiDim);
82
}
83
85
INLINE IScheduleMultiDim::IScheduleMultiDim(IScheduleMultiDim&& from) : id_(from.id_) {
86
// for debugging purposes
87
GUM_CONS_MOV(IScheduleMultiDim);
88
}
89
91
INLINE IScheduleMultiDim::~IScheduleMultiDim() {
92
// for debugging purposes
93
GUM_DESTRUCTOR(IScheduleMultiDim);
94
}
95
97
INLINE IScheduleMultiDim& IScheduleMultiDim::operator=(
const
IScheduleMultiDim& from) =
default
;
98
100
INLINE IScheduleMultiDim& IScheduleMultiDim::operator=(IScheduleMultiDim&& from) {
101
id_ = from.id_;
102
return
*
this
;
103
}
104
106
INLINE
bool
IScheduleMultiDim::operator==(
const
IScheduleMultiDim& m)
const
{
107
return
id_ == m.id_;
108
}
109
111
INLINE
bool
IScheduleMultiDim::operator!=(
const
IScheduleMultiDim& m)
const
{
112
return
id_ != m.id_;
113
}
114
116
INLINE Idx IScheduleMultiDim::id()
const
{
return
id_; }
117
118
}
/* namespace gum */
119
120
#endif
/* DOXYGEN_SHOULD_SKIP_THIS */
IScheduleMultiDim.h
The Table-agnostic base class of scheduleMultiDim.
agrum.h
gum::IScheduleMultiDim
The Table-agnostic base class of scheduleMultiDim.
Definition
IScheduleMultiDim.h:67
gum::IScheduleMultiDim::_newId_
static Idx _newId_()
returns a new distinct ID for each abstract scheduleMultiDim
gum::IScheduleMultiDim::IScheduleMultiDim
IScheduleMultiDim(const Idx id=0)
constructs a IScheduleMultiDim
gum::IScheduleMultiDim::_multidim_id_
static std::atomic< Idx > _multidim_id_
Definition
IScheduleMultiDim.h:208
gum::IScheduleMultiDim::resetIdGenerator
static void resetIdGenerator()
reset the id generator to 0
gum::Idx
Size Idx
Type for indexes.
Definition
types.h:79
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