aGrUM 3.0.0
a C++ library for (probabilistic) graphical models
gum::prm::PRM< GUM_SCALAR > Class Template Reference

This class represents a Probabilistic Relational PRMSystem<GUM_SCALAR>. More...

#include <agrum/PRM/PRM.h>

Collaboration diagram for gum::prm::PRM< GUM_SCALAR >:

Public Member Functions

Destructor.
 PRM ()
 Default constructor.
 ~PRM ()
 Destructor.
Getters and setters.
bool isType (std::string_view name) const
bool isClass (std::string_view name) const
bool isInterface (std::string_view name) const
bool isSystem (std::string_view name) const
PRMTypetype (std::string_view name)
 Returns a constant reference on a PRMType given it's name.
const PRMTypetype (std::string_view name) const
 Returns a constant reference on a PRMType given it's name.
const Set< PRMType * > & types () const
 Returns the Set of all PRMType in this PRM.
PRMClass< GUM_SCALAR > & getClass (std::string_view name)
 Returns a constant reference on a Class<GUM_SCALAR> given it's name.
const PRMClass< GUM_SCALAR > & getClass (std::string_view name) const
 Returns a constant reference on a Class<GUM_SCALAR> given it's name.
const Set< PRMClass< GUM_SCALAR > * > & classes () const
 Returns the Set of all Class<GUM_SCALAR> in this PRM.
PRMInterface< GUM_SCALAR > & getInterface (std::string_view name)
 Returns a constant reference on a Class<GUM_SCALAR> given it's name.
const PRMInterface< GUM_SCALAR > & getInterface (std::string_view name) const
 Returns a constant reference on a Class<GUM_SCALAR> given it's name.
const Set< PRMInterface< GUM_SCALAR > * > & interfaces () const
 Returns the Set of all Class<GUM_SCALAR> in this PRM.
PRMSystem< GUM_SCALAR > & getSystem (std::string_view name)
 Returns a constant reference on a PRMSystem<GUM_SCALAR> given it's name.
const PRMSystem< GUM_SCALAR > & getSystem (std::string_view name) const
 Returns a constant reference on a PRMSystem<GUM_SCALAR> given it's name.
const Set< PRMSystem< GUM_SCALAR > * > & systems () const
 Returns the Set of all Systems in this PRM.

Private Member Functions

Private methods.
 PRM (const PRM< GUM_SCALAR > &source)
 Copy constructor.
PRM< GUM_SCALAR > & operator= (const PRM< GUM_SCALAR > &source)
 Copy operator.
void _addBuiltInTypes_ ()
 Add the built-in types in the PRM.

Private Attributes

Private members.
HashTable< std::string, PRMClass< GUM_SCALAR > * > _classMap_
 Mapping of all Class<GUM_SCALAR> given their name.
Set< PRMClass< GUM_SCALAR > * > _classes_
 Set of all Class<GUM_SCALAR> in this PRM.
HashTable< std::string, PRMInterface< GUM_SCALAR > * > _interfaceMap_
 Mapping of all Class<GUM_SCALAR> given their name.
Set< PRMInterface< GUM_SCALAR > * > _interfaces_
 Set of all Class<GUM_SCALAR> in this PRM.
HashTable< std::string, PRMType * > _typeMap_
 Mapping of all PRMType given their name.
Set< PRMType * > _types_
 Set of all PRMType in this PRM.
HashTable< std::string, PRMSystem< GUM_SCALAR > * > _systemMap_
 Mapping of all Systems given their name.
Set< PRMSystem< GUM_SCALAR > * > _systems_
 Set of all Systems in this PRM.

Friends

class PRMFactory< GUM_SCALAR >

Detailed Description

template<GUM_Numeric GUM_SCALAR>
class gum::prm::PRM< GUM_SCALAR >

This class represents a Probabilistic Relational PRMSystem<GUM_SCALAR>.

Definition at line 74 of file PRM.h.

Constructor & Destructor Documentation

◆ PRM() [1/2]

template<GUM_Numeric GUM_SCALAR>
gum::prm::PRM< GUM_SCALAR >::PRM ( )

Default constructor.

Definition at line 57 of file PRM_tpl.h.

57 {
60 }
This class represents a Probabilistic Relational PRMSystem<GUM_SCALAR>.
Definition PRM.h:74
PRM()
Default constructor.
Definition PRM_tpl.h:57
void _addBuiltInTypes_()
Add the built-in types in the PRM.
Definition PRM_tpl.h:85

References PRM(), and _addBuiltInTypes_().

Referenced by PRM(), PRM(), ~PRM(), operator=(), and PRMFactory< GUM_SCALAR >.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~PRM()

template<GUM_Numeric GUM_SCALAR>
gum::prm::PRM< GUM_SCALAR >::~PRM ( )

Destructor.

Definition at line 64 of file PRM_tpl.h.

64 {
66 _classMap_.clear();
67 _typeMap_.clear();
68 _systemMap_.clear();
69
70 for (const auto sys: _systems_)
71 delete sys;
72
73 for (const auto cla: _classes_)
74 delete cla;
75
76 for (const auto inter: _interfaces_)
77 delete inter;
78
79 for (const auto typ: _types_)
80 delete typ;
81 }
HashTable< std::string, PRMType * > _typeMap_
Mapping of all PRMType given their name.
Definition PRM.h:235
Set< PRMType * > _types_
Set of all PRMType in this PRM.
Definition PRM.h:238
HashTable< std::string, PRMClass< GUM_SCALAR > * > _classMap_
Mapping of all Class<GUM_SCALAR> given their name.
Definition PRM.h:223
Set< PRMSystem< GUM_SCALAR > * > _systems_
Set of all Systems in this PRM.
Definition PRM.h:244
Set< PRMInterface< GUM_SCALAR > * > _interfaces_
Set of all Class<GUM_SCALAR> in this PRM.
Definition PRM.h:232
HashTable< std::string, PRMSystem< GUM_SCALAR > * > _systemMap_
Mapping of all Systems given their name.
Definition PRM.h:241
Set< PRMClass< GUM_SCALAR > * > _classes_
Set of all Class<GUM_SCALAR> in this PRM.
Definition PRM.h:226

References PRM(), _classes_, _classMap_, _interfaces_, _systemMap_, _systems_, _typeMap_, and _types_.

Here is the call graph for this function:

◆ PRM() [2/2]

template<GUM_Numeric GUM_SCALAR>
gum::prm::PRM< GUM_SCALAR >::PRM ( const PRM< GUM_SCALAR > & source)
private

Copy constructor.

Not Implemented.

References PRM().

Here is the call graph for this function:

Member Function Documentation

◆ _addBuiltInTypes_()

template<GUM_Numeric GUM_SCALAR>
void gum::prm::PRM< GUM_SCALAR >::_addBuiltInTypes_ ( )
private

Add the built-in types in the PRM.

Definition at line 85 of file PRM_tpl.h.

85 {
86 LabelizedVariable var("boolean", "built-in type", 0);
87 var.addLabel("false");
88 var.addLabel("true");
89 PRMType* boolean = new PRMType(var);
90 _types_.insert(boolean);
91 _typeMap_.insert("boolean", boolean);
92 }

References _typeMap_, _types_, and gum::LabelizedVariable::addLabel().

Referenced by PRM().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ classes()

template<GUM_Numeric GUM_SCALAR>
const Set< PRMClass< GUM_SCALAR > * > & gum::prm::PRM< GUM_SCALAR >::classes ( ) const

Returns the Set of all Class<GUM_SCALAR> in this PRM.

Definition at line 140 of file PRM_tpl.h.

140 {
141 return _classes_;
142 }

References _classes_.

◆ getClass() [1/2]

template<GUM_Numeric GUM_SCALAR>
PRMClass< GUM_SCALAR > & gum::prm::PRM< GUM_SCALAR >::getClass ( std::string_view name)

Returns a constant reference on a Class<GUM_SCALAR> given it's name.

Exceptions
NotFoundRaised if no class is found with the given name.

Definition at line 130 of file PRM_tpl.h.

130 {
131 return *(_classMap_[name]);
132 }

References _classMap_.

◆ getClass() [2/2]

template<GUM_Numeric GUM_SCALAR>
const PRMClass< GUM_SCALAR > & gum::prm::PRM< GUM_SCALAR >::getClass ( std::string_view name) const

Returns a constant reference on a Class<GUM_SCALAR> given it's name.

Exceptions
NotFoundRaised if no class is found with the given name.

Definition at line 135 of file PRM_tpl.h.

135 {
136 return *(_classMap_[name]);
137 }

References _classMap_.

◆ getInterface() [1/2]

template<GUM_Numeric GUM_SCALAR>
PRMInterface< GUM_SCALAR > & gum::prm::PRM< GUM_SCALAR >::getInterface ( std::string_view name)

Returns a constant reference on a Class<GUM_SCALAR> given it's name.

Exceptions
NotFoundRaised if no class is found with the given name.

Definition at line 145 of file PRM_tpl.h.

145 {
146 return *_interfaceMap_[name];
147 }
HashTable< std::string, PRMInterface< GUM_SCALAR > * > _interfaceMap_
Mapping of all Class<GUM_SCALAR> given their name.
Definition PRM.h:229

References _interfaceMap_.

◆ getInterface() [2/2]

template<GUM_Numeric GUM_SCALAR>
const PRMInterface< GUM_SCALAR > & gum::prm::PRM< GUM_SCALAR >::getInterface ( std::string_view name) const

Returns a constant reference on a Class<GUM_SCALAR> given it's name.

Exceptions
NotFoundRaised if no class is found with the given name.

Definition at line 150 of file PRM_tpl.h.

150 {
151 return *_interfaceMap_[name];
152 }

References _interfaceMap_.

◆ getSystem() [1/2]

template<GUM_Numeric GUM_SCALAR>
PRMSystem< GUM_SCALAR > & gum::prm::PRM< GUM_SCALAR >::getSystem ( std::string_view name)

Returns a constant reference on a PRMSystem<GUM_SCALAR> given it's name.

Exceptions
NotFoundRaised if no model is found with the given name.

Definition at line 160 of file PRM_tpl.h.

160 {
161 return *(_systemMap_[name]);
162 }

References _systemMap_.

◆ getSystem() [2/2]

template<GUM_Numeric GUM_SCALAR>
const PRMSystem< GUM_SCALAR > & gum::prm::PRM< GUM_SCALAR >::getSystem ( std::string_view name) const

Returns a constant reference on a PRMSystem<GUM_SCALAR> given it's name.

Exceptions
NotFoundRaised if no model is found with the given name.

Definition at line 165 of file PRM_tpl.h.

165 {
166 return *(_systemMap_[name]);
167 }

References _systemMap_.

◆ interfaces()

template<GUM_Numeric GUM_SCALAR>
const Set< PRMInterface< GUM_SCALAR > * > & gum::prm::PRM< GUM_SCALAR >::interfaces ( ) const

Returns the Set of all Class<GUM_SCALAR> in this PRM.

Definition at line 155 of file PRM_tpl.h.

155 {
156 return _interfaces_;
157 }

References _interfaces_.

◆ isClass()

template<GUM_Numeric GUM_SCALAR>
bool gum::prm::PRM< GUM_SCALAR >::isClass ( std::string_view name) const
Parameters
nameThe name of a possible Class<GUM_SCALAR> in this PRM.
Returns
Returns true if name names a Class<GUM_SCALAR> in this PRM.

Definition at line 100 of file PRM_tpl.h.

100 {
101 return _classMap_.exists(name);
102 }

References _classMap_.

◆ isInterface()

template<GUM_Numeric GUM_SCALAR>
bool gum::prm::PRM< GUM_SCALAR >::isInterface ( std::string_view name) const
Parameters
nameThe name of a possible PRMInterface<GUM_SCALAR> in this PRM.
Returns
Returns true if name names a PRMInterface<GUM_SCALAR> in this PRM.

Definition at line 105 of file PRM_tpl.h.

105 {
106 return _interfaceMap_.exists(name);
107 }

References _interfaceMap_.

◆ isSystem()

template<GUM_Numeric GUM_SCALAR>
bool gum::prm::PRM< GUM_SCALAR >::isSystem ( std::string_view name) const
Parameters
nameThe name of a possible PRMSystem<GUM_SCALAR> in this PRM.
Returns
Returns true if name names a PRMSystem<GUM_SCALAR> in this PRM.

Definition at line 110 of file PRM_tpl.h.

110 {
111 return _systemMap_.exists(name);
112 }

References _systemMap_.

◆ isType()

template<GUM_Numeric GUM_SCALAR>
bool gum::prm::PRM< GUM_SCALAR >::isType ( std::string_view name) const
Parameters
nameThe name of a possible PRMType in this PRM.
Returns
Returns true if name names a PRMType in this PRM.

Definition at line 95 of file PRM_tpl.h.

95 {
96 return _typeMap_.exists(name);
97 }

References _typeMap_.

◆ operator=()

template<GUM_Numeric GUM_SCALAR>
PRM< GUM_SCALAR > & gum::prm::PRM< GUM_SCALAR >::operator= ( const PRM< GUM_SCALAR > & source)
private

Copy operator.

Not Implemented.

References PRM().

Here is the call graph for this function:

◆ systems()

template<GUM_Numeric GUM_SCALAR>
const Set< PRMSystem< GUM_SCALAR > * > & gum::prm::PRM< GUM_SCALAR >::systems ( ) const

Returns the Set of all Systems in this PRM.

Definition at line 170 of file PRM_tpl.h.

170 {
171 return _systems_;
172 }

References _systems_.

◆ type() [1/2]

template<GUM_Numeric GUM_SCALAR>
PRMType & gum::prm::PRM< GUM_SCALAR >::type ( std::string_view name)

Returns a constant reference on a PRMType given it's name.

Exceptions
NotFoundRaised if no type is found with the given name.

Definition at line 115 of file PRM_tpl.h.

115 {
116 return *(_typeMap_[name]);
117 }

References _typeMap_.

◆ type() [2/2]

template<GUM_Numeric GUM_SCALAR>
const PRMType & gum::prm::PRM< GUM_SCALAR >::type ( std::string_view name) const

Returns a constant reference on a PRMType given it's name.

Exceptions
NotFoundRaised if no type is found with the given name.

Definition at line 120 of file PRM_tpl.h.

120 {
121 return *(_typeMap_[name]);
122 }

References _typeMap_.

◆ types()

template<GUM_Numeric GUM_SCALAR>
const Set< PRMType * > & gum::prm::PRM< GUM_SCALAR >::types ( ) const

Returns the Set of all PRMType in this PRM.

Definition at line 125 of file PRM_tpl.h.

125 {
126 return _types_;
127 }

References _types_.

◆ PRMFactory< GUM_SCALAR >

template<GUM_Numeric GUM_SCALAR>
friend class PRMFactory< GUM_SCALAR >
friend

Definition at line 251 of file PRM.h.

References PRM().

Member Data Documentation

◆ _classes_

template<GUM_Numeric GUM_SCALAR>
Set< PRMClass< GUM_SCALAR >* > gum::prm::PRM< GUM_SCALAR >::_classes_
private

Set of all Class<GUM_SCALAR> in this PRM.

Definition at line 226 of file PRM.h.

Referenced by ~PRM(), and classes().

◆ _classMap_

template<GUM_Numeric GUM_SCALAR>
HashTable< std::string, PRMClass< GUM_SCALAR >* > gum::prm::PRM< GUM_SCALAR >::_classMap_
private

Mapping of all Class<GUM_SCALAR> given their name.

Definition at line 223 of file PRM.h.

Referenced by ~PRM(), getClass(), getClass(), and isClass().

◆ _interfaceMap_

template<GUM_Numeric GUM_SCALAR>
HashTable< std::string, PRMInterface< GUM_SCALAR >* > gum::prm::PRM< GUM_SCALAR >::_interfaceMap_
private

Mapping of all Class<GUM_SCALAR> given their name.

Definition at line 229 of file PRM.h.

Referenced by getInterface(), getInterface(), and isInterface().

◆ _interfaces_

template<GUM_Numeric GUM_SCALAR>
Set< PRMInterface< GUM_SCALAR >* > gum::prm::PRM< GUM_SCALAR >::_interfaces_
private

Set of all Class<GUM_SCALAR> in this PRM.

Definition at line 232 of file PRM.h.

Referenced by ~PRM(), and interfaces().

◆ _systemMap_

template<GUM_Numeric GUM_SCALAR>
HashTable< std::string, PRMSystem< GUM_SCALAR >* > gum::prm::PRM< GUM_SCALAR >::_systemMap_
private

Mapping of all Systems given their name.

Definition at line 241 of file PRM.h.

Referenced by ~PRM(), getSystem(), getSystem(), and isSystem().

◆ _systems_

template<GUM_Numeric GUM_SCALAR>
Set< PRMSystem< GUM_SCALAR >* > gum::prm::PRM< GUM_SCALAR >::_systems_
private

Set of all Systems in this PRM.

Definition at line 244 of file PRM.h.

Referenced by ~PRM(), and systems().

◆ _typeMap_

template<GUM_Numeric GUM_SCALAR>
HashTable< std::string, PRMType* > gum::prm::PRM< GUM_SCALAR >::_typeMap_
private

Mapping of all PRMType given their name.

Definition at line 235 of file PRM.h.

Referenced by ~PRM(), _addBuiltInTypes_(), isType(), type(), and type().

◆ _types_

template<GUM_Numeric GUM_SCALAR>
Set< PRMType* > gum::prm::PRM< GUM_SCALAR >::_types_
private

Set of all PRMType in this PRM.

Definition at line 238 of file PRM.h.

Referenced by ~PRM(), _addBuiltInTypes_(), and types().


The documentation for this class was generated from the following files: