aGrUM 3.1.1
a C++ library for (probabilistic) graphical models
PRMParameter_tpl.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
49
50#include <agrum/PRM/elements/PRMParameter.h> // to ease IDE parser
51
52namespace gum {
53 namespace prm {
54
55 template < GUM_Numeric GUM_SCALAR >
58 GUM_SCALAR value) :
59 PRMClassElement< GUM_SCALAR >(name), _type_(type), _value_(value) {
60 GUM_CONSTRUCTOR(PRMParameter);
61 this->safeName_ = name;
62 }
63
64 template < GUM_Numeric GUM_SCALAR >
66 PRMClassElement< GUM_SCALAR >(source.name()), _type_(source.valueType()),
67 _value_(source.value()) {
68 GUM_ERROR(OperationNotAllowed, "cannot copy Paramter<GUM_SCALAR")
69 }
70
71 template < GUM_Numeric GUM_SCALAR >
74 GUM_ERROR(OperationNotAllowed, "cannot copy Paramter<GUM_SCALAR")
75 }
76
77 template < GUM_Numeric GUM_SCALAR >
81
82 template < GUM_Numeric GUM_SCALAR >
87
88 template < GUM_Numeric GUM_SCALAR >
90 return _value_;
91 }
92
93 template < GUM_Numeric GUM_SCALAR >
97
98 template < GUM_Numeric GUM_SCALAR >
103
104 template < GUM_Numeric GUM_SCALAR >
106 GUM_ERROR(OperationNotAllowed, "Parameters do not have a type")
107 }
108
109 template < GUM_Numeric GUM_SCALAR >
111 GUM_ERROR(OperationNotAllowed, "Parameters do not have a type")
112 }
113
114 template < GUM_Numeric GUM_SCALAR >
115 Tensor< GUM_SCALAR >& PRMParameter< GUM_SCALAR >::cpf() {
116 GUM_ERROR(OperationNotAllowed, "Parameters do not have a cpf")
117 }
118
119 template < GUM_Numeric GUM_SCALAR >
120 const Tensor< GUM_SCALAR >& PRMParameter< GUM_SCALAR >::cpf() const {
121 GUM_ERROR(OperationNotAllowed, "Parameters do not have a cpf")
122 }
123
124 template < GUM_Numeric GUM_SCALAR >
128
129 template < GUM_Numeric GUM_SCALAR >
133
134 template < GUM_Numeric GUM_SCALAR >
138
139 } /* namespace prm */
140} // namespace gum
Headers of gum::PRMParameter.
Exception : operation not allowed.
PRMAttribute is a member of a Class in a PRM.
Abstract class representing an element of PRM class.
PRMClassElement(std::string_view name)
Default constructor of a PRMClassElement.
ClassElementType
Returns true if obj_ptr is of type PRMReferenceSlot.
std::string safeName_
The safe name of this PRMClassElement.
const std::string & name() const
Returns the name of this object.
PRMParameter is a member of a Class in a PRM.
PRMAttribute< GUM_SCALAR > * getCastDescendant() const override
Raise a gum::OperationNotAllowed See gum::PRMClassElement::getCastDescendant().
PRMParameter< GUM_SCALAR > & operator=(const PRMParameter< GUM_SCALAR > &from)
Copy operator. Don't use it.
ParameterType valueType() const
See gum::PRMClassElement::elt_type().
void addChild(const gum::prm::PRMClassElement< GUM_SCALAR > &) override
See gum::PRMClassElement::addChild().
void addParent(const gum::prm::PRMClassElement< GUM_SCALAR > &) override
See gum::PRMClassElement::addParent().
PRMClassElement< GUM_SCALAR >::ClassElementType elt_type() const override
See gum::PRMClassElement::elt_type().
virtual Tensor< GUM_SCALAR > & cpf()
See gum::PRMClassElement::cpf().
PRMParameter(std::string_view name, ParameterType type, GUM_SCALAR value)
Constructor used by gum::Class.
~PRMParameter() override
Destructor.
PRMType & type() override
See gum::PRMClassElement::type().
GUM_SCALAR value() const
See gum::PRMClassElement::elt_type().
This is a decoration of the DiscreteVariable class.
Definition PRMType.h:78
#define GUM_ERROR(type, msg)
Definition exceptions.h:76
namespace for all probabilistic relational models entities
Definition agrum.h:68
gum is the global namespace for all aGrUM entities
Definition agrum.h:46