aGrUM
3.2.0
a C++ library for (probabilistic) graphical models
Toggle main menu visibility
O3InterfaceFactory.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
49
50
#include <memory>
51
#include <string>
52
53
#include <
agrum/PRM/o3prm/O3NameSolver.h
>
54
#include <
agrum/PRM/PRMFactory.h
>
55
56
#ifndef GUM_PRM_O3PRM_O3INTERFACE_FACTORY_H
57
# define GUM_PRM_O3PRM_O3INTERFACE_FACTORY_H
58
59
namespace
gum
{
60
namespace
prm
{
61
namespace
o3prm
{
62
72
template
< GUM_Numeric GUM_SCALAR >
73
class
GUM_PUBLIC_PRM
O3InterfaceFactory
{
74
public
:
75
O3InterfaceFactory
(
PRM< GUM_SCALAR >
&
prm
,
76
O3PRM
& o3_prm,
77
O3NameSolver< GUM_SCALAR >
& solver,
78
ErrorsContainer
& errors);
79
O3InterfaceFactory
(
const
O3InterfaceFactory< GUM_SCALAR >
& src);
80
O3InterfaceFactory
(
O3InterfaceFactory< GUM_SCALAR >
&& src);
81
~O3InterfaceFactory
();
82
O3InterfaceFactory< GUM_SCALAR >
&
operator=
(
const
O3InterfaceFactory< GUM_SCALAR >
& src);
83
O3InterfaceFactory< GUM_SCALAR >
&
operator=
(
O3InterfaceFactory< GUM_SCALAR >
&& src);
84
85
void
buildInterfaces
();
86
87
void
buildElements
();
88
89
private
:
90
PRM< GUM_SCALAR >
*
_prm_
;
91
O3PRM
*
_o3_prm_
;
92
O3NameSolver< GUM_SCALAR >
*
_solver_
;
93
ErrorsContainer
*
_errors_
;
94
95
HashTable< std::string, std::string >
_eltName_
;
96
HashTable< std::string, gum::NodeId >
_nameMap_
;
97
HashTable< std::string, O3Interface* >
_interfaceMap_
;
98
HashTable< NodeId, O3Interface* >
_nodeMap_
;
99
DAG
_dag_
;
100
std::vector< O3Interface* >
_o3Interface_
;
101
102
bool
_addInterface2Dag_
();
103
104
bool
_addArcs2Dag_
();
105
106
void
_setO3InterfaceCreationOrder_
();
107
108
bool
_checkO3Interfaces_
();
109
110
bool
_checkInterfaceElement_
(
O3Interface
& i,
O3InterfaceElement
& elt);
111
112
bool
_checkOverloadLegality_
(
O3Interface
& i,
O3InterfaceElement
& elt);
113
114
bool
_checkAttributeOverloadLegality_
(
O3Interface
& i,
O3InterfaceElement
& elt);
115
116
bool
_checkReferenceOverloadLegality_
(
O3Interface
& i,
O3InterfaceElement
& elt);
117
118
bool
_checkCyclicReference_
(
O3Interface
& i,
O3InterfaceElement
& elt);
119
};
120
121
}
// namespace o3prm
122
}
// namespace prm
123
}
// namespace gum
124
125
// always include the implementation of the templates
126
# include <
agrum/PRM/o3prm/O3InterfaceFactory_tpl.h
>
127
128
129
# ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
130
extern
template
class
gum::prm::o3prm::O3InterfaceFactory< double >
;
131
# endif
132
133
134
#endif
// GUM_PRM_O3PRM_O3INTERFACE_FACTORY_H
O3InterfaceFactory_tpl.h
Implementation for the O3InterfaceFactory class.
O3NameSolver.h
Headers for the O3NameSolver class.
PRMFactory.h
Headers of PRMFactory.
gum::DAG
Base class for dag.
Definition
DAG.h:121
gum::ErrorsContainer
This class is used contain and manipulate gum::ParseError.
Definition
errorsContainer.h:180
gum::HashTable< std::string, std::string >
gum::prm::PRM
This class represents a Probabilistic Relational PRMSystem<GUM_SCALAR>.
Definition
PRM.h:74
gum::prm::o3prm::O3InterfaceElement
The O3InterfaceElement is part of the AST of the O3PRM language.
Definition
O3prm.h:344
gum::prm::o3prm::O3InterfaceFactory
Bulds gum::prm:PRMInterface from gum::prm::o3prm::O3Interface.
Definition
O3InterfaceFactory.h:73
gum::prm::o3prm::O3InterfaceFactory::operator=
O3InterfaceFactory< GUM_SCALAR > & operator=(const O3InterfaceFactory< GUM_SCALAR > &src)
Definition
O3InterfaceFactory_tpl.h:88
gum::prm::o3prm::O3InterfaceFactory::_interfaceMap_
HashTable< std::string, O3Interface * > _interfaceMap_
Definition
O3InterfaceFactory.h:97
gum::prm::o3prm::O3InterfaceFactory::_checkOverloadLegality_
bool _checkOverloadLegality_(O3Interface &i, O3InterfaceElement &elt)
Definition
O3InterfaceFactory_tpl.h:228
gum::prm::o3prm::O3InterfaceFactory::buildInterfaces
void buildInterfaces()
Definition
O3InterfaceFactory_tpl.h:109
gum::prm::o3prm::O3InterfaceFactory::_checkInterfaceElement_
bool _checkInterfaceElement_(O3Interface &i, O3InterfaceElement &elt)
Definition
O3InterfaceFactory_tpl.h:207
gum::prm::o3prm::O3InterfaceFactory::_nameMap_
HashTable< std::string, gum::NodeId > _nameMap_
Definition
O3InterfaceFactory.h:96
gum::prm::o3prm::O3InterfaceFactory::_addArcs2Dag_
bool _addArcs2Dag_()
Definition
O3InterfaceFactory_tpl.h:148
gum::prm::o3prm::O3InterfaceFactory::_checkAttributeOverloadLegality_
bool _checkAttributeOverloadLegality_(O3Interface &i, O3InterfaceElement &elt)
Definition
O3InterfaceFactory_tpl.h:245
gum::prm::o3prm::O3InterfaceFactory::_prm_
PRM< GUM_SCALAR > * _prm_
Definition
O3InterfaceFactory.h:90
gum::prm::o3prm::O3InterfaceFactory::_dag_
DAG _dag_
Definition
O3InterfaceFactory.h:99
gum::prm::o3prm::O3InterfaceFactory::buildElements
void buildElements()
Definition
O3InterfaceFactory_tpl.h:179
gum::prm::o3prm::O3InterfaceFactory::_eltName_
HashTable< std::string, std::string > _eltName_
Definition
O3InterfaceFactory.h:95
gum::prm::o3prm::O3InterfaceFactory::_checkO3Interfaces_
bool _checkO3Interfaces_()
Definition
O3InterfaceFactory_tpl.h:124
gum::prm::o3prm::O3InterfaceFactory::_checkCyclicReference_
bool _checkCyclicReference_(O3Interface &i, O3InterfaceElement &elt)
Definition
O3InterfaceFactory_tpl.h:299
gum::prm::o3prm::O3InterfaceFactory::_o3Interface_
std::vector< O3Interface * > _o3Interface_
Definition
O3InterfaceFactory.h:100
gum::prm::o3prm::O3InterfaceFactory::O3InterfaceFactory
O3InterfaceFactory(PRM< GUM_SCALAR > &prm, O3PRM &o3_prm, O3NameSolver< GUM_SCALAR > &solver, ErrorsContainer &errors)
Definition
O3InterfaceFactory_tpl.h:59
gum::prm::o3prm::O3InterfaceFactory::_addInterface2Dag_
bool _addInterface2Dag_()
Definition
O3InterfaceFactory_tpl.h:129
gum::prm::o3prm::O3InterfaceFactory::_solver_
O3NameSolver< GUM_SCALAR > * _solver_
Definition
O3InterfaceFactory.h:92
gum::prm::o3prm::O3InterfaceFactory::_errors_
ErrorsContainer * _errors_
Definition
O3InterfaceFactory.h:93
gum::prm::o3prm::O3InterfaceFactory::_checkReferenceOverloadLegality_
bool _checkReferenceOverloadLegality_(O3Interface &i, O3InterfaceElement &elt)
Definition
O3InterfaceFactory_tpl.h:268
gum::prm::o3prm::O3InterfaceFactory::_setO3InterfaceCreationOrder_
void _setO3InterfaceCreationOrder_()
Definition
O3InterfaceFactory_tpl.h:171
gum::prm::o3prm::O3InterfaceFactory::_o3_prm_
O3PRM * _o3_prm_
Definition
O3InterfaceFactory.h:91
gum::prm::o3prm::O3InterfaceFactory::_nodeMap_
HashTable< NodeId, O3Interface * > _nodeMap_
Definition
O3InterfaceFactory.h:98
gum::prm::o3prm::O3Interface
The O3Interface is part of the AST of the O3PRM language.
Definition
O3prm.h:377
gum::prm::o3prm::O3NameSolver
Resolves names for the different O3PRM factories.
Definition
O3NameSolver.h:75
gum::prm::o3prm::O3PRM
The O3PRM is part of the AST of the O3PRM language.
Definition
O3prm.h:915
gum::prm::o3prm
Definition
O3ClassFactory.h:62
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