aGrUM 3.1.1
a C++ library for (probabilistic) graphical models
PRMReferenceSlot.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
48
49#ifndef GUM_REFERENCE_SLOT_H
50#define GUM_REFERENCE_SLOT_H
51
54
55namespace gum {
56 namespace prm {
57
78 // ==========================================================================
79 template < GUM_Numeric GUM_SCALAR >
80 class PRMReferenceSlot: public PRMClassElement< GUM_SCALAR > {
81 public:
82 // ========================================================================
84 // ========================================================================
86
94 PRMReferenceSlot(std::string_view name,
96 bool isArray = false);
97
101 ~PRMReferenceSlot() override;
102
104 // ========================================================================
106 // ========================================================================
108
113
119
125
129 bool isArray() const;
130
132 void addParent(const PRMClassElement< GUM_SCALAR >& elt) override;
133
135 void addChild(const PRMClassElement< GUM_SCALAR >& elt) override;
136
138 // ========================================================================
140 // ========================================================================
142
145 PRMType& type() override;
146
149 const PRMType& type() const override;
150
153 virtual Tensor< GUM_SCALAR >& cpf();
154
157 const Tensor< GUM_SCALAR >& cpf() const override;
158
162
164
165 private:
166 // ========================================================================
168 // ========================================================================
169 // @{
170
173
176
178 // ========================================================================
180 // ========================================================================
181 // @{
182
185
188
190 };
191
192
193#ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
194 extern template class PRMReferenceSlot< double >;
195#endif
196
197
198 } /* namespace prm */
199} // namespace gum
200
202
203#endif /* GUM_CLASS_ELEMENT_H */
Headers of gum::prm::PRMClassElementContainer.
Headers of gum::PRMClassElement.
Inline implementation of gum::PRMReferenceSlot.
PRMAttribute is a member of a Class in a PRM.
<agrum/PRM/classElementContainer.h>
PRMClassElement(std::string_view name)
Default constructor of a PRMClassElement.
ClassElementType
Returns true if obj_ptr is of type PRMReferenceSlot.
const std::string & name() const
Returns the name of this object.
A PRMReferenceSlot represent a relation between two PRMClassElementContainer.
PRMReferenceSlot & operator=(const PRMReferenceSlot< GUM_SCALAR > &from)
Copy operator. Don't use it.
PRMAttribute< GUM_SCALAR > * getCastDescendant() const override
Raise an OperationNotAllowed. See gum::PRMClassElement::getCastDescendant().
bool _isArray_
Flag indicating if this slot is an array.
virtual Tensor< GUM_SCALAR > & cpf()
Raise an OperationNotAllowed. See gum::PRMClassElement::cpf().
PRMType & type() override
Raise an OperationNotAllowed. See gum::PRMClassElement::type().
PRMClassElement< GUM_SCALAR >::ClassElementType elt_type() const override
Implementation of the pure virtual method of PRMObject.
PRMClassElementContainer< GUM_SCALAR > & _slotType_
The type of this PRMReferenceSlot.
void addParent(const PRMClassElement< GUM_SCALAR > &elt) override
See gum::PRMClassElement::addParent().
bool isArray() const
Returns true if this reference slot is an array.
PRMClassElementContainer< GUM_SCALAR > & slotType()
Returns the type of this slot, which is a PRMClassElementContainer (it is not the type of PRMObject).
PRMReferenceSlot(std::string_view name, PRMClassElementContainer< GUM_SCALAR > &type, bool isArray=false)
Default constructor.
void addChild(const PRMClassElement< GUM_SCALAR > &elt) override
See gum::PRMClassElement::addChild().
~PRMReferenceSlot() override
Destructor.
This is a decoration of the DiscreteVariable class.
Definition PRMType.h:78
namespace for all probabilistic relational models entities
Definition agrum.h:68
gum is the global namespace for all aGrUM entities
Definition agrum.h:46