aGrUM
3.2.0
a C++ library for (probabilistic) graphical models
Toggle main menu visibility
PRMParameter.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_PARAMETER_H
50
#define GUM_PARAMETER_H
51
52
53
#include <
agrum/PRM/elements/PRMAttribute.h
>
54
#include <
agrum/PRM/elements/PRMType.h
>
55
56
namespace
gum
{
57
namespace
prm
{
58
67
template
< GUM_Numeric GUM_SCALAR >
68
class
PRMParameter
:
public
PRMClassElement
< GUM_SCALAR > {
69
public
:
70
enum
ParameterType
{
INT
,
REAL
};
71
72
// ========================================================================
74
// ========================================================================
76
84
PRMParameter
(std::string_view
name
, ParameterType
type
, GUM_SCALAR
value
);
85
87
~PRMParameter
()
override
;
88
90
// ========================================================================
92
// ========================================================================
94
96
typename
PRMClassElement< GUM_SCALAR >::ClassElementType
elt_type
()
const override
;
97
98
GUM_SCALAR
value
()
const
;
99
100
void
value
(GUM_SCALAR
value
);
101
102
ParameterType
valueType
()
const
;
103
105
PRMType
&
type
()
override
;
106
108
const
PRMType
&
type
()
const override
;
109
111
virtual
Tensor< GUM_SCALAR >&
cpf
();
112
114
const
Tensor< GUM_SCALAR >&
cpf
()
const override
;
115
117
void
addParent
(
const
gum::prm::PRMClassElement< GUM_SCALAR >
&)
override
;
118
120
void
addChild
(
const
gum::prm::PRMClassElement< GUM_SCALAR >
&)
override
;
121
124
PRMAttribute< GUM_SCALAR >
*
getCastDescendant
()
const override
;
125
127
128
protected
:
130
PRMParameter
(
const
PRMParameter< GUM_SCALAR >
& source);
131
133
PRMParameter< GUM_SCALAR >
&
operator=
(
const
PRMParameter< GUM_SCALAR >
& from);
134
135
private
:
136
// ========================================================================
138
// ========================================================================
140
141
ParameterType
_type_
;
142
143
GUM_SCALAR
_value_
;
144
146
};
147
148
149
#ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
150
extern
template
class
PRMParameter< double >
;
151
#endif
152
153
154
}
/* namespace prm */
155
}
// namespace gum
156
157
#include <
agrum/PRM/elements/PRMParameter_tpl.h
>
158
159
#endif
/* GUM_PARAMETER_H */
PRMAttribute.h
Headers of gum::PRMAttribute.
PRMParameter_tpl.h
Implementation of gum::PRMParameter.
PRMType.h
Headers of Class.
gum::prm::PRMAttribute
PRMAttribute is a member of a Class in a PRM.
Definition
PRMAttribute.h:79
gum::prm::PRMClassElement
Abstract class representing an element of PRM class.
Definition
PRMClassElement.h:75
gum::prm::PRMClassElement::PRMClassElement
PRMClassElement(std::string_view name)
Default constructor of a PRMClassElement.
Definition
PRMClassElement_tpl.h:57
gum::prm::PRMClassElement::ClassElementType
ClassElementType
Returns true if obj_ptr is of type PRMReferenceSlot.
Definition
PRMClassElement.h:109
gum::prm::PRMObject::name
const std::string & name() const
Returns the name of this object.
Definition
PRMObject_inl.h:57
gum::prm::PRMParameter
PRMParameter is a member of a Class in a PRM.
Definition
PRMParameter.h:68
gum::prm::PRMParameter::getCastDescendant
PRMAttribute< GUM_SCALAR > * getCastDescendant() const override
Raise a gum::OperationNotAllowed See gum::PRMClassElement::getCastDescendant().
Definition
PRMParameter_tpl.h:135
gum::prm::PRMParameter::operator=
PRMParameter< GUM_SCALAR > & operator=(const PRMParameter< GUM_SCALAR > &from)
Copy operator. Don't use it.
Definition
PRMParameter_tpl.h:73
gum::prm::PRMParameter::valueType
ParameterType valueType() const
See gum::PRMClassElement::elt_type().
Definition
PRMParameter_tpl.h:100
gum::prm::PRMParameter::addChild
void addChild(const gum::prm::PRMClassElement< GUM_SCALAR > &) override
See gum::PRMClassElement::addChild().
Definition
PRMParameter_tpl.h:130
gum::prm::PRMParameter::addParent
void addParent(const gum::prm::PRMClassElement< GUM_SCALAR > &) override
See gum::PRMClassElement::addParent().
Definition
PRMParameter_tpl.h:125
gum::prm::PRMParameter::elt_type
PRMClassElement< GUM_SCALAR >::ClassElementType elt_type() const override
See gum::PRMClassElement::elt_type().
Definition
PRMParameter_tpl.h:84
gum::prm::PRMParameter::cpf
virtual Tensor< GUM_SCALAR > & cpf()
See gum::PRMClassElement::cpf().
Definition
PRMParameter_tpl.h:115
gum::prm::PRMParameter::PRMParameter
PRMParameter(std::string_view name, ParameterType type, GUM_SCALAR value)
Constructor used by gum::Class.
Definition
PRMParameter_tpl.h:56
gum::prm::PRMParameter::_type_
ParameterType _type_
Definition
PRMParameter.h:141
gum::prm::PRMParameter::_value_
GUM_SCALAR _value_
Definition
PRMParameter.h:143
gum::prm::PRMParameter::type
PRMType & type() override
See gum::PRMClassElement::type().
Definition
PRMParameter_tpl.h:105
gum::prm::PRMParameter::ParameterType
ParameterType
Definition
PRMParameter.h:70
gum::prm::PRMParameter::INT
@ INT
Definition
PRMParameter.h:70
gum::prm::PRMParameter::REAL
@ REAL
Definition
PRMParameter.h:70
gum::prm::PRMParameter::value
GUM_SCALAR value() const
See gum::PRMClassElement::elt_type().
Definition
PRMParameter_tpl.h:89
gum::prm::PRMType
This is a decoration of the DiscreteVariable class.
Definition
PRMType.h:78
gum::prm
namespace for all probabilistic relational models entities
Definition
agrum.h:68
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