aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
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-2025 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-2025 *
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
55
56namespace gum {
57 namespace prm {
58
67 template < typename GUM_SCALAR >
68 class PRMParameter: public PRMClassElement< GUM_SCALAR > {
69 public:
71
72 // ========================================================================
74 // ========================================================================
76
84 PRMParameter(const std::string& name, ParameterType type, GUM_SCALAR value);
85
87 virtual ~PRMParameter();
88
90 // ========================================================================
92 // ========================================================================
94
97
98 GUM_SCALAR value() const;
99
100 void value(GUM_SCALAR value);
101
102 ParameterType valueType() const;
103
105 virtual PRMType& type();
106
108 virtual const PRMType& type() const;
109
111 virtual Tensor< GUM_SCALAR >& cpf();
112
114 virtual const Tensor< GUM_SCALAR >& cpf() const;
115
118
121
125
127
128 protected:
131
134
135 private:
136 // ========================================================================
138 // ========================================================================
140
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
158
159#endif /* GUM_PARAMETER_H */
Headers of gum::PRMAttribute.
Implementation of gum::PRMParameter.
Headers of Class.
PRMAttribute is a member of a Class in a PRM.
Abstract class representing an element of PRM class.
PRMClassElement(const std::string &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.
PRMParameter is a member of a Class in a PRM.
void addChild(const gum::prm::PRMClassElement< GUM_SCALAR > &)
See gum::PRMClassElement::addChild().
PRMParameter< GUM_SCALAR > & operator=(const PRMParameter< GUM_SCALAR > &from)
Copy operator. Don't use it.
virtual PRMClassElement< GUM_SCALAR >::ClassElementType elt_type() const
See gum::PRMClassElement::elt_type().
ParameterType valueType() const
See gum::PRMClassElement::elt_type().
PRMParameter(const std::string &name, ParameterType type, GUM_SCALAR value)
Constructor used by gum::Class.
virtual ~PRMParameter()
Destructor.
virtual Tensor< GUM_SCALAR > & cpf()
See gum::PRMClassElement::cpf().
virtual PRMType & type()
See gum::PRMClassElement::type().
GUM_SCALAR value() const
See gum::PRMClassElement::elt_type().
virtual PRMAttribute< GUM_SCALAR > * getCastDescendant() const
Raise a gum::OperationNotAllowed See gum::PRMClassElement::getCastDescendant().
void addParent(const gum::prm::PRMClassElement< GUM_SCALAR > &)
See gum::PRMClassElement::addParent().
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