aGrUM
3.2.0
a C++ library for (probabilistic) graphical models
Toggle main menu visibility
multiDimAdressable.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
52
53
#ifndef GUM_MULTIDIM_ADRESSABLE_H
54
#define GUM_MULTIDIM_ADRESSABLE_H
55
56
#include <iostream>
57
#include <vector>
58
59
#include <
agrum/agrum.h
>
60
61
#include <
agrum/base/multidim/instantiation.h
>
62
63
namespace
gum
{
64
// =========================================================================
65
// === GUM_MULTI_DIM_ADRESSABLE ===
66
// =========================================================================
78
class
GUM_SHARED_PUBLIC
MultiDimAdressable
:
public
MultiDimInterface
{
79
public
:
80
// =======================================================================
82
// =======================================================================
84
88
MultiDimAdressable
();
89
93
MultiDimAdressable
(
const
MultiDimAdressable
& from);
94
MultiDimAdressable
&
operator=
(
const
MultiDimAdressable
& from);
95
99
MultiDimAdressable
(
MultiDimAdressable
&&)
noexcept
;
100
MultiDimAdressable
&
operator=
(
MultiDimAdressable
&& from)
noexcept
;
101
102
106
~MultiDimAdressable
()
override
;
107
109
// =======================================================================
111
// =======================================================================
113
118
virtual
MultiDimAdressable
&
getMasterRef
() = 0;
119
125
virtual
const
MultiDimAdressable
&
getMasterRef
()
const
= 0;
126
132
virtual
bool
registerSlave
(
Instantiation
& i) = 0;
133
139
virtual
bool
unregisterSlave
(
Instantiation
& i) = 0;
140
148
virtual
void
changeNotification
(
const
Instantiation
& i,
149
const
DiscreteVariable
*
const
var,
150
Idx
oldval,
151
Idx
newval) = 0;
152
157
virtual
void
setFirstNotification
(
const
Instantiation
& i) = 0;
158
163
virtual
void
setLastNotification
(
const
Instantiation
& i) = 0;
164
169
virtual
void
setIncNotification
(
const
Instantiation
& i) = 0;
170
175
virtual
void
setDecNotification
(
const
Instantiation
& i) = 0;
176
181
virtual
void
setChangeNotification
(
const
Instantiation
& i) = 0;
182
188
virtual
std::string
toString
(
const
Instantiation
* i)
const
= 0;
189
191
};
192
193
}
/* namespace gum */
194
195
#ifndef GUM_NO_INLINE
196
# include <
agrum/base/multidim/implementations/multiDimAdressable_inl.h
>
197
#endif
/* GUM_NO_INLINE */
198
199
#endif
/* GUM_MULTIDIM_ADRESSABLE_H */
agrum.h
gum::DiscreteVariable
Base class for discrete random variable.
Definition
discreteVariable.h:80
gum::Instantiation
Class for assigning/browsing values to tuples of discrete variables.
Definition
instantiation.h:102
gum::MultiDimAdressable::toString
virtual std::string toString(const Instantiation *i) const =0
Return a string representation of internal data about i in this.
gum::MultiDimAdressable::MultiDimAdressable
MultiDimAdressable()
Default constructor.
Definition
multiDimAdressable_inl.h:66
gum::MultiDimAdressable::setChangeNotification
virtual void setChangeNotification(const Instantiation &i)=0
Listen to an assignment of a value in a Instantiation.
gum::MultiDimAdressable::setLastNotification
virtual void setLastNotification(const Instantiation &i)=0
Listen to setLast in a given Instantiation.
gum::MultiDimAdressable::setFirstNotification
virtual void setFirstNotification(const Instantiation &i)=0
Listen to setFirst in a given Instantiation.
gum::MultiDimAdressable::setDecNotification
virtual void setDecNotification(const Instantiation &i)=0
Listen to increment in each recorded Instantiation.
gum::MultiDimAdressable::registerSlave
virtual bool registerSlave(Instantiation &i)=0
Register i as a slave of this MultiDimAdressable.
gum::MultiDimAdressable::getMasterRef
virtual const MultiDimAdressable & getMasterRef() const =0
In order to insure the dereference for decorators, we need to virtualize the access to master pointer...
gum::MultiDimAdressable::getMasterRef
virtual MultiDimAdressable & getMasterRef()=0
In order to insure the dereference for decorators, we need to virtualize the access to master pointer...
gum::MultiDimAdressable::changeNotification
virtual void changeNotification(const Instantiation &i, const DiscreteVariable *const var, Idx oldval, Idx newval)=0
Listen to changes in a given Instantiation.
gum::MultiDimAdressable::setIncNotification
virtual void setIncNotification(const Instantiation &i)=0
Listen to increment in a given Instantiation.
gum::MultiDimAdressable::unregisterSlave
virtual bool unregisterSlave(Instantiation &i)=0
Unregister i as a slave of this MultiDimAdressable.
gum::MultiDimAdressable::operator=
MultiDimAdressable & operator=(const MultiDimAdressable &from)
Default constructor.
Definition
multiDimAdressable_inl.h:74
gum::MultiDimInterface
Interface for all classes addressing in a multiDim fashion.
Definition
multiDimInterface.h:82
gum::Idx
Size Idx
Type for indexes.
Definition
types.h:79
instantiation.h
Header files of gum::Instantiation.
multiDimAdressable_inl.h
Inline implementation for the abstract base class for all multi dimensionnal containers.
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