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

An PRMInstance is a Bayesian network fragment defined by a Class and used in a PRMSystem. More...

#include <PRMInstance.h>

Inheritance diagram for gum::prm::PRMInstance< GUM_SCALAR >:
Collaboration diagram for gum::prm::PRMInstance< GUM_SCALAR >:

Classes

class  RefIterator
 Nested class to iterate over PRMReferenceSlot and PRMSlotChain<GUM_SCALAR> instantiations. More...
class  RefConstIterator
 Nested class to iterate over PRMReferenceSlot and PRMSlotChain<GUM_SCALAR> instantiations. More...

Public Member Functions

Constructors & private operators.
 PRMInstance (std::string_view name, PRMClass< GUM_SCALAR > &type)
 Default constructor of an PRMInstance<GUM_SCALAR>.
 ~PRMInstance () override
 Destructor.
Getters & setters.
prm_type obj_type () const override
 Returns the PRM type of this object.
PRMClass< GUM_SCALAR > & type ()
 Returns the type of this instance.
const PRMClass< GUM_SCALAR > & type () const
 Returns the type of this instance.
bool exists (NodeId id) const
 Returns true if id matches an PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.
bool exists (std::string_view name) const
 Returns true if name matches an PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.
PRMAttribute< GUM_SCALAR > & get (NodeId id)
 Getter on an PRMAttribute<GUM_SCALAR> of this PRMInstance<GUM_SCALAR>.
PRMAttribute< GUM_SCALAR > & get (std::string_view name)
 Given a name returns the related PRMAttribute<GUM_SCALAR>.
const PRMAttribute< GUM_SCALAR > & get (NodeId id) const
 Getter on an PRMAttribute<GUM_SCALAR> of this PRMInstance<GUM_SCALAR>.
const PRMAttribute< GUM_SCALAR > & get (std::string_view name) const
 Given a name returns the related PRMClassElement.
Size size () const
 Returns the number of attributes in this PRMInstance<GUM_SCALAR>.
Instantiation methods.
void instantiate ()
 Instantiate all nodes which requires it.
const Bijection< const DiscreteVariable *, const DiscreteVariable * > & bijection () const
 Returns a mapping between DiscreteVariable used in this and the ones used in this PRMInstance<GUM_SCALAR>'s Class<GUM_SCALAR>.
Reference handling.
void add (NodeId id, PRMInstance< GUM_SCALAR > &instance)
 Add an PRMInstance<GUM_SCALAR> to a given PRMReferenceSlot, PRMSlotChain<GUM_SCALAR> or output node.
const PRMInstance< GUM_SCALAR > & getInstance (NodeId id) const
 Fast access to the first instance in a PRMReferenceSlot or PRMSlotChain<GUM_SCALAR>.
const Set< PRMInstance< GUM_SCALAR > * > & getInstances (NodeId id) const
 Returns the Set of PRMInstance<GUM_SCALAR> referenced by id.
bool hasRefAttr (NodeId id) const
 Returns true if id has at least one referring PRMAttribute<GUM_SCALAR>.
std::vector< std::pair< PRMInstance< GUM_SCALAR > *, std::string > > & getRefAttr (NodeId id)
 Returns a vector of pairs of refering attributes of id.
const std::vector< std::pair< PRMInstance< GUM_SCALAR > *, std::string > > & getRefAttr (NodeId id) const
 Returns a vector of pairs of refering attributes of id.
Getters & setters.
const std::string & name () const
 Returns the name of this object.
void name (std::string_view name)
 Change the name of the PRM Object.
Operators
bool operator== (const PRMObject &obj) const
 To PRMObject are equal if they have the same name (which is unique).
bool operator!= (const PRMObject &obj) const
 To PRMObject are equal if they have the same name (which is unique).

Private Member Functions

 PRMInstance (const PRMInstance< GUM_SCALAR > &source)
 Copy constructor.
PRMInstance< GUM_SCALAR > & operator= (const PRMClass< GUM_SCALAR > &from)
 Copy operator. Don't use it.
Private instantiation methods.
void _copyAggregates_ (PRMAggregate< GUM_SCALAR > *source)
 Used at construction to instantiate aggregates.
void _copyAttribute_ (PRMAttribute< GUM_SCALAR > *source)
 Used at construction to instantiate attributes.
void _doInstantiate_ ()
 Starts this instance instantiations.
void _instantiateSlotChain_ (PRMSlotChain< GUM_SCALAR > *sc)
 Retrieve all instances referred by sc.
void _copyAttributeCPF_ (PRMAttribute< GUM_SCALAR > *attr)
 Copy the content of an PRMAttribute<GUM_SCALAR> from its Class<GUM_SCALAR> counterpart.
void _addReferingInstance_ (PRMSlotChain< GUM_SCALAR > *sc, PRMInstance< GUM_SCALAR > *i)
 Add this as a referring instance over the attribute pointed by sc in i.

Private Attributes

Private members.
std::string _name_

Iterators

using iterator = typename NodeProperty< PRMAttribute< GUM_SCALAR >* >::iterator
 Alias to iterate over the gum::prm::PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.
using const_iterator = typename NodeProperty< PRMAttribute< GUM_SCALAR >* >::const_iterator
 Alias to iterate over the gum::prm::PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.
using InvRefIterator
 Alias to iterate over the gum::prm::PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.
using InvRefConstIterator
 Alias to iterate over the gum::prm::PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.
iterator begin ()
 Returns an iterator at the begining of the list of gum::prm::PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.
const iteratorend ()
 Returns a reference over the iterator at the end of the list of gum::prm::PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.
const_iterator begin () const
 Returns an iterator at the beginning of the list of gum::prm::PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.
const const_iteratorend () const
 Returns a reference over the iterator at the end of the list of gum::prm::PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.
RefIterator begin (NodeId id)
 Returns an iterator at the beginning of the set of PRMInstance<GUM_SCALAR> associated to a given gum::prm::PRMReferenceSlot or gum::prm::PRMSlotChain<GUM_SCALAR>.
RefConstIterator begin (NodeId id) const
 Returns an iterator at the beginning of the set of PRMInstance<GUM_SCALAR> associated to a given gum::prm::PRMReferenceSlot or gum::prm::PRMSlotChain<GUM_SCALAR>.
InvRefIterator beginInvRef ()
 Alias to iterate over the gum::prm::PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.
const InvRefIteratorendInvRef ()
 Alias to iterate over the gum::prm::PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.
InvRefConstIterator beginInvRef () const
 Alias to iterate over the gum::prm::PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.
const InvRefConstIteratorendInvRef () const
 Alias to iterate over the gum::prm::PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.

Built-in types.

enum class  prm_type : char {
  ALL , CLASS , PRM_INTERFACE , CLASS_ELT ,
  TYPE , SYSTEM , INSTANCE
}
 Enumeration of the different types of objects handled by a PRM. More...
static std::string LEFT_CAST ()
 Enumeration of the different types of objects handled by a PRM.
static std::string RIGHT_CAST ()
 Enumeration of the different types of objects handled by a PRM.
static std::string enum2str (prm_type type)
 Returns the string representation of a PRMObject.
static INLINE bool isClass (const PRMObject &obj)
 Returns true if obj_ptr is of type Class.
static INLINE bool isInterface (const PRMObject &obj)
 Returns true if obj_ptr is of type PRMInterface.
static INLINE bool isInstance (const PRMObject &obj)
 Returns true if obj_ptr is of type PRMInstance.

Private members.

using pair = std::pair< PRMInstance< GUM_SCALAR >*, std::string >
 Code alias.
bool _instantiated_
 True if this instance has been instantiated.
PRMClass< GUM_SCALAR > * _type_
 The type of this PRMInstance<GUM_SCALAR>.
NodeProperty< PRMAttribute< GUM_SCALAR > * > _nodeIdMap_
 The gum::prm::PRMAttribute<GUM_SCALAR> and gum::prm::PRMAggregate<GUM_SCALAR> of this PRMInstance<GUM_SCALAR>.
NodeProperty< Set< PRMInstance< GUM_SCALAR > * > * > _referenceMap_
 Mapping between the gum::prm::PRMReferenceSlot and gum::prm::PRMSlotChain<GUM_SCALAR> in type / and the PRMInstance<GUM_SCALAR> associated with it.
NodeProperty< std::vector< pair > * > _referingAttr_
 The set of pair (instance, attribute) referring an attribute of this instance.
Bijection< const DiscreteVariable *, const DiscreteVariable * > _bijection_
 A bijection used for MultiDim handling.

Detailed Description

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

An PRMInstance is a Bayesian network fragment defined by a Class and used in a PRMSystem.

Before using an PRMInstance for inference YOU MUST call PRMInstance::instantiateSlotChains() and PRMInstance::instantiate() on it before, otherwise DiscreteVariable pointers will be inconsistent and inference will be erroneous. Of course, this must be done once you have set all reference in the current system.

See also
PRMClass PRM PRMClassElement

Definition at line 79 of file PRMInstance.h.

Member Typedef Documentation

◆ const_iterator

template<GUM_Numeric GUM_SCALAR>
using gum::prm::PRMInstance< GUM_SCALAR >::const_iterator = typename NodeProperty< PRMAttribute< GUM_SCALAR >* >::const_iterator

Alias to iterate over the gum::prm::PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.

Definition at line 340 of file PRMInstance.h.

◆ InvRefConstIterator

template<GUM_Numeric GUM_SCALAR>
using gum::prm::PRMInstance< GUM_SCALAR >::InvRefConstIterator
Initial value:
typename NodeProperty<
std::vector< std::pair< PRMInstance< GUM_SCALAR >*, std::string > >* >::const_iterator
typename NodeProperty< PRMAttribute< GUM_SCALAR > * >::const_iterator const_iterator
Alias to iterate over the gum::prm::PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.
HashTable< NodeId, VAL > NodeProperty
Property on graph elements.

Alias to iterate over the gum::prm::PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.

Definition at line 455 of file PRMInstance.h.

◆ InvRefIterator

template<GUM_Numeric GUM_SCALAR>
using gum::prm::PRMInstance< GUM_SCALAR >::InvRefIterator
Initial value:
typename NodeProperty<
std::vector< std::pair< PRMInstance< GUM_SCALAR >*, std::string > >* >::iterator
typename NodeProperty< PRMAttribute< GUM_SCALAR > * >::iterator iterator
Alias to iterate over the gum::prm::PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.

Alias to iterate over the gum::prm::PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.

Definition at line 453 of file PRMInstance.h.

◆ iterator

template<GUM_Numeric GUM_SCALAR>
using gum::prm::PRMInstance< GUM_SCALAR >::iterator = typename NodeProperty< PRMAttribute< GUM_SCALAR >* >::iterator

Alias to iterate over the gum::prm::PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.

Definition at line 327 of file PRMInstance.h.

◆ pair

template<GUM_Numeric GUM_SCALAR>
using gum::prm::PRMInstance< GUM_SCALAR >::pair = std::pair< PRMInstance< GUM_SCALAR >*, std::string >
private

Code alias.

Definition at line 531 of file PRMInstance.h.

Member Enumeration Documentation

◆ prm_type

enum class gum::prm::PRMObject::prm_type : char
stronginherited

Enumeration of the different types of objects handled by a PRM.

The "all" type is used to tell that we want any kind of PRMType (useful with iterators for example). No PRMObject will ever have "all" as type.

Enumerator
ALL 
CLASS 
PRM_INTERFACE 
CLASS_ELT 
TYPE 
SYSTEM 
INSTANCE 

Definition at line 90 of file PRMObject.h.

90: char { ALL, CLASS, PRM_INTERFACE, CLASS_ELT, TYPE, SYSTEM, INSTANCE };

Constructor & Destructor Documentation

◆ PRMInstance() [1/2]

template<GUM_Numeric GUM_SCALAR>
gum::prm::PRMInstance< GUM_SCALAR >::PRMInstance ( std::string_view name,
PRMClass< GUM_SCALAR > & type )

Default constructor of an PRMInstance<GUM_SCALAR>.

When you create an PRMInstance<GUM_SCALAR> all gum::prm::PRMAttribute<GUM_SCALAR> in it's type are added, except for gum::prm::PRMAggregate<GUM_SCALAR> and parameters which are instantiated.

However neither of their children or parents are updated (i.e. DiscreteVariable pointers are inconsistent).

Definition at line 57 of file PRMInstance_tpl.h.

57 :
60
61 // First we create attributes for each aggregate in type
62 for (const auto agg: _type_->aggregates())
64
65 // We add attributes in type by reference for inner ones and by copy for
66 // output ones
67 for (const auto attr: _type_->attributes())
69 }
An PRMInstance is a Bayesian network fragment defined by a Class and used in a PRMSystem.
Definition PRMInstance.h:79
void _copyAttribute_(PRMAttribute< GUM_SCALAR > *source)
Used at construction to instantiate attributes.
bool _instantiated_
True if this instance has been instantiated.
void _copyAggregates_(PRMAggregate< GUM_SCALAR > *source)
Used at construction to instantiate aggregates.
PRMClass< GUM_SCALAR > * _type_
The type of this PRMInstance<GUM_SCALAR>.
PRMClass< GUM_SCALAR > & type()
Returns the type of this instance.
PRMInstance(std::string_view name, PRMClass< GUM_SCALAR > &type)
Default constructor of an PRMInstance<GUM_SCALAR>.
PRMObject(std::string_view name)
Constructor.
Definition PRMObject.cpp:62
const std::string & name() const
Returns the name of this object.

References PRMInstance(), gum::prm::PRMObject::PRMObject(), _copyAggregates_(), _copyAttribute_(), _instantiated_, _type_, gum::prm::PRMObject::name(), and type().

Referenced by PRMInstance(), PRMInstance(), gum::prm::PRMInstance< GUM_SCALAR >::RefConstIterator::RefConstIterator(), gum::prm::PRMInstance< GUM_SCALAR >::RefIterator::RefIterator(), gum::prm::PRMInstance< GUM_SCALAR >::RefIterator::RefIterator(), ~PRMInstance(), _addReferingInstance_(), add(), getInstance(), gum::prm::PRMInstance< GUM_SCALAR >::RefIterator::operator*(), and gum::prm::PRMInstance< GUM_SCALAR >::RefIterator::operator->().

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

◆ ~PRMInstance()

template<GUM_Numeric GUM_SCALAR>
gum::prm::PRMInstance< GUM_SCALAR >::~PRMInstance ( )
override

Destructor.

Definition at line 72 of file PRMInstance_tpl.h.

72 {
74
75 for (const auto& elt: _nodeIdMap_)
76 delete elt.second;
77
78 for (const auto& elt: _referenceMap_)
79 delete elt.second;
80
81 for (const auto& elt: _referingAttr_)
82 delete elt.second;
83 }
NodeProperty< PRMAttribute< GUM_SCALAR > * > _nodeIdMap_
The gum::prm::PRMAttribute<GUM_SCALAR> and gum::prm::PRMAggregate<GUM_SCALAR> of this PRMInstance<GUM...
NodeProperty< Set< PRMInstance< GUM_SCALAR > * > * > _referenceMap_
Mapping between the gum::prm::PRMReferenceSlot and gum::prm::PRMSlotChain<GUM_SCALAR> in type / and t...
NodeProperty< std::vector< pair > * > _referingAttr_
The set of pair (instance, attribute) referring an attribute of this instance.

References PRMInstance(), _nodeIdMap_, _referenceMap_, and _referingAttr_.

Here is the call graph for this function:

◆ PRMInstance() [2/2]

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

Copy constructor.

Definition at line 265 of file PRMInstance_tpl.h.

265 :
268 GUM_ERROR(FatalError, "do not copy Instance")
269 }
#define GUM_ERROR(type, msg)
Definition exceptions.h:76

References PRMInstance(), gum::prm::PRMObject::PRMObject(), _type_, and GUM_ERROR.

Here is the call graph for this function:

Member Function Documentation

◆ _addReferingInstance_()

template<GUM_Numeric GUM_SCALAR>
void gum::prm::PRMInstance< GUM_SCALAR >::_addReferingInstance_ ( PRMSlotChain< GUM_SCALAR > * sc,
PRMInstance< GUM_SCALAR > * i )
private

Add this as a referring instance over the attribute pointed by sc in i.

Parameters
scA slot chain pointing over an attribute in i.
iAn instance holding an attribute pointed by sc.

Definition at line 329 of file PRMInstance_tpl.h.

330 {
331 NodeId id = i->get(sc->lastElt().safeName()).id();
332 std::string name = sc->lastElt().safeName();
333
334 auto p_rm = i->_referenceMap_.tryGet(id);
335 if (!p_rm) {
336 i->_referenceMap_.insert(id, new Set< PRMInstance< GUM_SCALAR >* >());
337 i->_referingAttr_.insert(id, new std::vector< pair >());
338 p_rm = i->_referenceMap_.tryGet(id);
339 }
340 (*p_rm)->insert(this);
341 (*i->_referingAttr_.tryGet(id))->push_back(std::make_pair(this, sc->lastElt().safeName()));
342 }
PRMAttribute< GUM_SCALAR > & get(NodeId id)
Getter on an PRMAttribute<GUM_SCALAR> of this PRMInstance<GUM_SCALAR>.

References PRMInstance(), _referenceMap_, _referingAttr_, get(), gum::prm::PRMSlotChain< GUM_SCALAR >::lastElt(), and gum::prm::PRMObject::name().

Referenced by _instantiateSlotChain_().

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

◆ _copyAggregates_()

template<GUM_Numeric GUM_SCALAR>
void gum::prm::PRMInstance< GUM_SCALAR >::_copyAggregates_ ( PRMAggregate< GUM_SCALAR > * source)
private

Used at construction to instantiate aggregates.

Definition at line 243 of file PRMInstance_tpl.h.

243 {
245 source->type(),
246 source->buildImpl());
247 GUM_ASSERT(&(attr->type().variable()) != &(source->type().variable()));
248 attr->setId(source->id());
249 _nodeIdMap_.insert(attr->id(), attr);
250 _bijection_.insert(&(source->type().variable()), &(attr->type().variable()));
251 }
Bijection< const DiscreteVariable *, const DiscreteVariable * > _bijection_
A bijection used for MultiDim handling.

References _bijection_, _nodeIdMap_, gum::prm::PRMAggregate< GUM_SCALAR >::buildImpl(), gum::prm::PRMClassElement< GUM_SCALAR >::id(), gum::prm::PRMObject::name(), gum::prm::PRMAggregate< GUM_SCALAR >::type(), and gum::prm::PRMType::variable().

Referenced by PRMInstance().

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

◆ _copyAttribute_()

template<GUM_Numeric GUM_SCALAR>
void gum::prm::PRMInstance< GUM_SCALAR >::_copyAttribute_ ( PRMAttribute< GUM_SCALAR > * source)
private

Used at construction to instantiate attributes.

Parameters
sourceAn attribute in type.

Definition at line 254 of file PRMInstance_tpl.h.

254 {
256 GUM_ASSERT(&(attr->type().variable()) != &(source->type().variable()));
257 // The tensor is copied when instantiate() is called
258 attr->cpf().fill((GUM_SCALAR)0);
259 attr->setId(source->id());
260 _bijection_.insert(&(source->type().variable()), &(attr->type().variable()));
261 _nodeIdMap_.insert(attr->id(), attr);
262 }

References _bijection_, _nodeIdMap_, gum::prm::PRMClassElement< GUM_SCALAR >::id(), gum::prm::PRMObject::name(), gum::prm::PRMAttribute< GUM_SCALAR >::type(), and gum::prm::PRMType::variable().

Referenced by PRMInstance().

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

◆ _copyAttributeCPF_()

template<GUM_Numeric GUM_SCALAR>
void gum::prm::PRMInstance< GUM_SCALAR >::_copyAttributeCPF_ ( PRMAttribute< GUM_SCALAR > * attr)
private

Copy the content of an PRMAttribute<GUM_SCALAR> from its Class<GUM_SCALAR> counterpart.

Parameters
attrAn PRMAttribute<GUM_SCALAR> of this PRMInstance<GUM_SCALAR>.
Exceptions
OperationNotAllowedIf the MultiDimImplementation is of an unknown type.

Definition at line 569 of file PRMInstance_tpl.h.

569 {
570 const auto& type_attr
571 = static_cast< const PRMAttribute< GUM_SCALAR >& >(type().get(attr->safeName()));
572 attr->copyCpf(bijection(), type_attr);
573 GUM_ASSERT(attr->cpf().contains(attr->type().variable()));
574 }
const Bijection< const DiscreteVariable *, const DiscreteVariable * > & bijection() const
Returns a mapping between DiscreteVariable used in this and the ones used in this PRMInstance<GUM_SCA...

References bijection(), gum::prm::PRMAttribute< GUM_SCALAR >::copyCpf(), gum::prm::PRMAttribute< GUM_SCALAR >::cpf(), gum::prm::PRMClassElement< GUM_SCALAR >::safeName(), gum::prm::PRMAttribute< GUM_SCALAR >::type(), type(), and gum::prm::PRMType::variable().

Referenced by _doInstantiate_().

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

◆ _doInstantiate_()

template<GUM_Numeric GUM_SCALAR>
void gum::prm::PRMInstance< GUM_SCALAR >::_doInstantiate_ ( )
private

Starts this instance instantiations.

Definition at line 94 of file PRMInstance_tpl.h.

94 {
95 // First retrieving any referenced instance
96 for (const auto chain: type().slotChains()) {
98 }
99
100 // Now we need to add referred instance to each input node
101 // For Attributes we first add parents, then we initialize CPF
102 for (const auto attr: type().attributes()) {
103 _copyAttributeCPF_(_nodeIdMap_[(*attr).id()]);
104 }
105
106 // For PRMAggregate<GUM_SCALAR> we add parents
107 for (const auto agg: type().aggregates()) {
108 PRMAttribute< GUM_SCALAR >& attr = get(agg->safeName());
109
110 for (const auto node: type().containerDag().parents(agg->id())) {
111 if (auto p_node = _nodeIdMap_.tryGet(node)) {
112 attr.addParent(*(*p_node));
113 } else {
114 auto elt = &(type().get(node));
115 auto sc = static_cast< PRMSlotChain< GUM_SCALAR >* >(elt);
116
117 if (auto p_ref = _referenceMap_.tryGet(sc->id())) {
118 for (const auto inst: *(*p_ref)) {
119 attr.addParent(inst->get(sc->lastElt().safeName()));
120 }
121 }
122 }
123 }
124 }
125 }
void _instantiateSlotChain_(PRMSlotChain< GUM_SCALAR > *sc)
Retrieve all instances referred by sc.
void _copyAttributeCPF_(PRMAttribute< GUM_SCALAR > *attr)
Copy the content of an PRMAttribute<GUM_SCALAR> from its Class<GUM_SCALAR> counterpart.

References _copyAttributeCPF_(), _instantiateSlotChain_(), _nodeIdMap_, _referenceMap_, gum::prm::PRMAttribute< GUM_SCALAR >::addParent(), get(), and type().

Referenced by instantiate().

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

◆ _instantiateSlotChain_()

template<GUM_Numeric GUM_SCALAR>
void gum::prm::PRMInstance< GUM_SCALAR >::_instantiateSlotChain_ ( PRMSlotChain< GUM_SCALAR > * sc)
private

Retrieve all instances referred by sc.

Parameters
scA slot chain of this instance's type.
Exceptions
NotFoundRaised if a reference in sc is not instantiated.

Definition at line 128 of file PRMInstance_tpl.h.

128 {
129 auto first_id = sc->chain()[0]->id();
130 auto p_first = _referenceMap_.tryGet(first_id);
131 if (!p_first) { return; }
132 auto set = new Set< PRMInstance< GUM_SCALAR >* >(*(*p_first));
133 // We proceed with a width-first run of the slot chain
134 for (Size idx = 1; idx < sc->chain().size() - 1; ++idx) {
135 auto temp = new Set< PRMInstance< GUM_SCALAR >* >();
136 for (auto current: *set) {
137 auto& ref = current->type().get(sc->chain()[idx]->name());
138 for (auto next: *(current->_referenceMap_[ref.id()])) {
139 temp->insert(next);
140 }
141 }
142 delete set;
143 set = temp;
144 }
145
146 GUM_ASSERT(set->size() > 0);
147 // set contains all the instances references by sc
148 if (auto p_ref = _referenceMap_.tryGet(sc->id())) {
149 delete *p_ref;
150 *p_ref = set;
151 } else {
152 _referenceMap_.insert(sc->id(), set);
153 }
154
155 // Add refering instances
156 for (auto i: *set) {
158 }
159
160 // If sc is not multiple so it can be added as a parent of an attribute
161 if (!sc->isMultiple()) {
162 // We should have only one instance
163 // Less ugly way to get the single instance in set
164 for (auto instance: *set) {
165 auto& attr = instance->get(sc->lastElt().safeName());
166 _bijection_.insert(&(sc->type().variable()), &(attr.type().variable()));
167 }
168 }
169 }
Size size() const
Returns the number of attributes in this PRMInstance<GUM_SCALAR>.
void _addReferingInstance_(PRMSlotChain< GUM_SCALAR > *sc, PRMInstance< GUM_SCALAR > *i)
Add this as a referring instance over the attribute pointed by sc in i.

References _addReferingInstance_(), _bijection_, _referenceMap_, gum::prm::PRMSlotChain< GUM_SCALAR >::chain(), gum::prm::PRMClassElement< GUM_SCALAR >::id(), gum::prm::PRMSlotChain< GUM_SCALAR >::isMultiple(), gum::prm::PRMSlotChain< GUM_SCALAR >::lastElt(), size(), gum::prm::PRMSlotChain< GUM_SCALAR >::type(), and gum::prm::PRMType::variable().

Referenced by _doInstantiate_().

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

◆ add()

template<GUM_Numeric GUM_SCALAR>
void gum::prm::PRMInstance< GUM_SCALAR >::add ( NodeId id,
PRMInstance< GUM_SCALAR > & instance )

Add an PRMInstance<GUM_SCALAR> to a given PRMReferenceSlot, PRMSlotChain<GUM_SCALAR> or output node.

Three type of nodes can be associated with an PRMInstance<GUM_SCALAR>. When an PRMInstance<GUM_SCALAR> is associated with a PRMReferenceSlot, it represents an arc in the relational skeleton. For a PRMSlotChain<GUM_SCALAR>, it is a placeholder of referenced PRMClassElement by this PRMInstance<GUM_SCALAR>. Finally, for an output node it indicates that an PRMInstance<GUM_SCALAR> has an PRMClassElement referring it.

Parameters
idThe NodeId of a PRMReferenceSlot of this PRMInstance<GUM_SCALAR>.
instanceThe instance added as references by id in this PRMInstance<GUM_SCALAR>.
Exceptions
WrongClassElementRaised if id is not a valid PRMClassElement.
OutOfBoundsRaised if no more PRMInstance<GUM_SCALAR> can be added to id.
PRMTypeErrorRaised if instance's type isn't compatible with the reference's type.
NotFoundIf there is no PRMClassElement given id.

Definition at line 172 of file PRMInstance_tpl.h.

172 {
173 if (!type().exists(id))
174 GUM_ERROR(NotFound, "no ClassElement<GUM_SCALAR> matches the given id")
175 PRMClassElement< GUM_SCALAR >* elt = &(type().get(id));
176
177 switch (elt->elt_type()) {
180
181 // Checking if instance's type is legal
182 if (!instance.type().isSubTypeOf(ref->slotType())) {
184 "given Instance type is not a proper "
185 "subclass of the ReferenceSlot<GUM_SCALAR> slot type");
186 }
187
188 // Checking the reference's size limit
189 if (auto p_ref_slot = _referenceMap_.tryGet(id);
191 && (!static_cast< PRMReferenceSlot< GUM_SCALAR >& >(type().get(id)).isArray())
192 && ((*p_ref_slot)->size() == 1)) {
193 GUM_ERROR(OutOfBounds, "ReferenceSlot<GUM_SCALAR> size limit reached")
194 }
195
196 break;
197 }
198
201 = static_cast< PRMSlotChain< GUM_SCALAR >& >(type().get(id));
202
203 // Checking if instance's type is legal
204 if (!instance.type().isSubTypeOf(sc.end())) {
206 "given Instance type is not a proper "
207 "subclass of the ClassElementContainer pointed"
208 " by the SlotChain<GUM_SCALAR>");
209 }
210
211 // Checking the reference's size limit
212 if (auto p_ref_sc = _referenceMap_.tryGet(id);
213 p_ref_sc && (!static_cast< PRMSlotChain< GUM_SCALAR >& >(type().get(id)).isMultiple())
214 && ((*p_ref_sc)->size() == 1)) {
215 GUM_ERROR(OutOfBounds, "SlotChain<GUM_SCALAR> size limit reached")
216 }
217
218 break;
219 }
220
221 default : {
222 if (!type().isOutputNode(*elt)) {
223 GUM_ERROR(WrongClassElement, "given ClassElement<GUM_SCALAR> is not an output node")
224 }
225 }
226 }
227
228 auto p_ref_add = _referenceMap_.tryGet(id);
229 if (!p_ref_add) {
230 _referenceMap_.insert(id, new Set< PRMInstance< GUM_SCALAR >* >());
231 p_ref_add = _referenceMap_.tryGet(id);
232 }
233
234 (*p_ref_add)->insert(&instance);
235 }
bool exists(NodeId id) const
Returns true if id matches an PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.
const iterator & end()
Returns a reference over the iterator at the end of the list of gum::prm::PRMAttribute<GUM_SCALAR> in...

References PRMInstance(), _referenceMap_, gum::prm::PRMClassElement< GUM_SCALAR >::elt_type(), gum::prm::PRMSlotChain< GUM_SCALAR >::end(), exists(), get(), GUM_ERROR, gum::prm::PRMClassElement< GUM_SCALAR >::prm_refslot, gum::prm::PRMClassElement< GUM_SCALAR >::prm_slotchain, gum::prm::PRMReferenceSlot< GUM_SCALAR >::slotType(), and type().

Here is the call graph for this function:

◆ begin() [1/4]

template<GUM_Numeric GUM_SCALAR>
PRMInstance< GUM_SCALAR >::iterator gum::prm::PRMInstance< GUM_SCALAR >::begin ( )

Returns an iterator at the begining of the list of gum::prm::PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.

Definition at line 376 of file PRMInstance_tpl.h.

376 {
377 return _nodeIdMap_.begin();
378 }

References _nodeIdMap_.

Referenced by gum::prm::PRMInstance< GUM_SCALAR >::RefConstIterator::RefConstIterator(), gum::prm::PRMInstance< GUM_SCALAR >::RefIterator::RefIterator(), gum::prm::SVE< GUM_SCALAR >::_eliminateNodes_(), gum::prm::StructuredInference< GUM_SCALAR >::_reduceAloneInstances_(), and gum::prm::StructuredInference< GUM_SCALAR >::searchPatterns().

Here is the caller graph for this function:

◆ begin() [2/4]

template<GUM_Numeric GUM_SCALAR>
PRMInstance< GUM_SCALAR >::const_iterator gum::prm::PRMInstance< GUM_SCALAR >::begin ( ) const

Returns an iterator at the beginning of the list of gum::prm::PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.

Definition at line 386 of file PRMInstance_tpl.h.

386 {
387 return _nodeIdMap_.begin();
388 }

References _nodeIdMap_.

◆ begin() [3/4]

template<GUM_Numeric GUM_SCALAR>
PRMInstance< GUM_SCALAR >::RefIterator gum::prm::PRMInstance< GUM_SCALAR >::begin ( NodeId id)

Returns an iterator at the beginning of the set of PRMInstance<GUM_SCALAR> associated to a given gum::prm::PRMReferenceSlot or gum::prm::PRMSlotChain<GUM_SCALAR>.

Parameters
idA gum::prm::PRMReferenceSlot or gum::prm::PRMSlotChain<GUM_SCALAR> in this PRMInstance<GUM_SCALAR> type.
Exceptions
NotFoundRaised if no gum::prm::PRMClassElement in this PRMInstance<GUM_SCALAR> type matches id.
WrongClassElementRaised if id is neither a PRMReferenceSlot or PRMSlotChain<GUM_SCALAR>.

Definition at line 397 of file PRMInstance_tpl.h.

397 {
398 auto p = _referenceMap_.tryGet(id);
399 if (!p) GUM_ERROR(NotFound, "no referred instances from this NodeId")
401 }
Nested class to iterate over PRMReferenceSlot and PRMSlotChain<GUM_SCALAR> instantiations.

References _referenceMap_, and GUM_ERROR.

◆ begin() [4/4]

template<GUM_Numeric GUM_SCALAR>
PRMInstance< GUM_SCALAR >::RefConstIterator gum::prm::PRMInstance< GUM_SCALAR >::begin ( NodeId id) const

Returns an iterator at the beginning of the set of PRMInstance<GUM_SCALAR> associated to a given gum::prm::PRMReferenceSlot or gum::prm::PRMSlotChain<GUM_SCALAR>.

Parameters
idA gum::prm::PRMReferenceSlot or gum::prm::PRMSlotChain<GUM_SCALAR> in this PRMInstance<GUM_SCALAR> type.
Exceptions
NotFoundRaised if no gum::prm::PRMClassElement in this PRMInstance<GUM_SCALAR> type matches id.
WrongClassElementRaised if id is neither a PRMReferenceSlot or PRMSlotChain<GUM_SCALAR>.

Definition at line 405 of file PRMInstance_tpl.h.

405 {
406 auto p = _referenceMap_.tryGet(id);
407 if (!p) GUM_ERROR(NotFound, "no referred instances from this NodeId")
409 }
Nested class to iterate over PRMReferenceSlot and PRMSlotChain<GUM_SCALAR> instantiations.

References _referenceMap_, and GUM_ERROR.

◆ beginInvRef() [1/2]

template<GUM_Numeric GUM_SCALAR>
PRMInstance< GUM_SCALAR >::InvRefIterator gum::prm::PRMInstance< GUM_SCALAR >::beginInvRef ( )

Alias to iterate over the gum::prm::PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.

Definition at line 528 of file PRMInstance_tpl.h.

528 {
529 return _referingAttr_.begin();
530 }

References _referingAttr_.

Referenced by gum::prm::SVE< GUM_SCALAR >::_eliminateNodes_(), gum::prm::SVE< GUM_SCALAR >::_eliminateNodesDownward_(), and gum::prm::SVE< GUM_SCALAR >::_eliminateNodesUpward_().

Here is the caller graph for this function:

◆ beginInvRef() [2/2]

template<GUM_Numeric GUM_SCALAR>
PRMInstance< GUM_SCALAR >::InvRefConstIterator gum::prm::PRMInstance< GUM_SCALAR >::beginInvRef ( ) const

Alias to iterate over the gum::prm::PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.

Definition at line 540 of file PRMInstance_tpl.h.

540 {
541 return _referingAttr_.begin();
542 }

References _referingAttr_.

◆ bijection()

template<GUM_Numeric GUM_SCALAR>
const Bijection< const DiscreteVariable *, const DiscreteVariable * > & gum::prm::PRMInstance< GUM_SCALAR >::bijection ( ) const

Returns a mapping between DiscreteVariable used in this and the ones used in this PRMInstance<GUM_SCALAR>'s Class<GUM_SCALAR>.

MultiDims require distinctive DiscreteVariable pointers, thus interface attributes are always instantiated to prevent multiple insertion of the same DiscreteVariable pointer in a MultiDim.

Returns
Returns a bijection in which first elements are DiscreteVariable in this->type() and the second are in this.

Definition at line 346 of file PRMInstance_tpl.h.

346 {
347 return _bijection_;
348 }

References _bijection_.

Referenced by _copyAttributeCPF_(), gum::prm::SVE< GUM_SCALAR >::_insertLiftedNodes_(), gum::prm::SVED< GUM_SCALAR >::_insertLiftedNodes_(), and gum::prm::StructuredInference< GUM_SCALAR >::_reduceAloneInstances_().

Here is the caller graph for this function:

◆ end() [1/2]

template<GUM_Numeric GUM_SCALAR>
const PRMInstance< GUM_SCALAR >::iterator & gum::prm::PRMInstance< GUM_SCALAR >::end ( )

Returns a reference over the iterator at the end of the list of gum::prm::PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.

Definition at line 381 of file PRMInstance_tpl.h.

381 {
382 return _nodeIdMap_.end();
383 }

References _nodeIdMap_.

Referenced by gum::prm::SVE< GUM_SCALAR >::_eliminateNodes_(), gum::prm::StructuredInference< GUM_SCALAR >::_reduceAloneInstances_(), and gum::prm::PRMInference< GUM_SCALAR >::posterior().

Here is the caller graph for this function:

◆ end() [2/2]

template<GUM_Numeric GUM_SCALAR>
const PRMInstance< GUM_SCALAR >::const_iterator & gum::prm::PRMInstance< GUM_SCALAR >::end ( ) const

Returns a reference over the iterator at the end of the list of gum::prm::PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.

Definition at line 392 of file PRMInstance_tpl.h.

392 {
393 return _nodeIdMap_.end();
394 }

References _nodeIdMap_.

◆ endInvRef() [1/2]

template<GUM_Numeric GUM_SCALAR>
const PRMInstance< GUM_SCALAR >::InvRefIterator & gum::prm::PRMInstance< GUM_SCALAR >::endInvRef ( )

Alias to iterate over the gum::prm::PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.

Definition at line 534 of file PRMInstance_tpl.h.

534 {
535 return _referingAttr_.end();
536 }

References _referingAttr_.

Referenced by gum::prm::SVE< GUM_SCALAR >::_eliminateNodes_(), gum::prm::SVE< GUM_SCALAR >::_eliminateNodesDownward_(), and gum::prm::SVE< GUM_SCALAR >::_eliminateNodesUpward_().

Here is the caller graph for this function:

◆ endInvRef() [2/2]

template<GUM_Numeric GUM_SCALAR>
const PRMInstance< GUM_SCALAR >::InvRefConstIterator & gum::prm::PRMInstance< GUM_SCALAR >::endInvRef ( ) const

Alias to iterate over the gum::prm::PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.

Definition at line 546 of file PRMInstance_tpl.h.

546 {
547 return _referingAttr_.end();
548 }

References _referingAttr_.

◆ enum2str()

INLINE std::string gum::prm::PRMObject::enum2str ( prm_type type)
staticinherited

Returns the string representation of a PRMObject.

Definition at line 75 of file PRMObject_inl.h.

75 {
76 switch (type) {
77 case prm_type::CLASS : return "PRMType::CLASS";
78
79 case prm_type::CLASS_ELT : return "PRMType::CLASS_ELT";
80
81 case prm_type::TYPE : return "PRMType::TYPE";
82
83 case prm_type::SYSTEM : return "PRMType::SYSTEM";
84
85 case prm_type::INSTANCE : return "PRMType::INSTANCE";
86
87 case prm_type::PRM_INTERFACE : return "PRMType::PRM_INTERFACE";
88
89 default : return "unknown";
90 }
91 }

References CLASS, CLASS_ELT, INSTANCE, PRM_INTERFACE, SYSTEM, and TYPE.

Referenced by gum::prm::operator<<().

Here is the caller graph for this function:

◆ exists() [1/2]

template<GUM_Numeric GUM_SCALAR>
bool gum::prm::PRMInstance< GUM_SCALAR >::exists ( NodeId id) const

Returns true if id matches an PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.

Definition at line 293 of file PRMInstance_tpl.h.

293 {
294 return _nodeIdMap_.exists(id);
295 }

References _nodeIdMap_.

Referenced by gum::prm::InstanceBayesNet< GUM_SCALAR >::_init_(), gum::prm::StructuredBayesBall< GUM_SCALAR >::_isHardEvidence_(), add(), exists(), gum::prm::o3prmr::O3prmrInterpreter::findAttributeName(), get(), and get().

Here is the caller graph for this function:

◆ exists() [2/2]

template<GUM_Numeric GUM_SCALAR>
bool gum::prm::PRMInstance< GUM_SCALAR >::exists ( std::string_view name) const

Returns true if name matches an PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.

Definition at line 298 of file PRMInstance_tpl.h.

298 {
299 return _type_->exists(name) && exists(_type_->get(name).id());
300 }

References _type_, exists(), and gum::prm::PRMObject::name().

Here is the call graph for this function:

◆ get() [1/4]

template<GUM_Numeric GUM_SCALAR>
PRMAttribute< GUM_SCALAR > & gum::prm::PRMInstance< GUM_SCALAR >::get ( NodeId id)

Getter on an PRMAttribute<GUM_SCALAR> of this PRMInstance<GUM_SCALAR>.

Recall that PRMAggregate<GUM_SCALAR> are instantiated as PRMAttribute<GUM_SCALAR> when an PRMInstance<GUM_SCALAR> is created. Thus any random variable contained in this PRMInstance<GUM_SCALAR> is mapped to an PRMAttribute<GUM_SCALAR>.

Parameters
idThe PRMAttribute<GUM_SCALAR> id.
Returns
Returns a constant reference on an PRMAttribute<GUM_SCALAR>.
Exceptions
NotFoundRaised if no PRMAttribute<GUM_SCALAR> matches name.

Definition at line 303 of file PRMInstance_tpl.h.

303 {
304 auto p = _nodeIdMap_.tryGet(id);
305 if (!p) GUM_ERROR(NotFound, "no PRMAttribute<GUM_SCALAR> with the given NodeId")
306 return *(*p);
307 }

References _nodeIdMap_, and GUM_ERROR.

Referenced by gum::prm::SVE< GUM_SCALAR >::_addDelayedVariable_(), _addReferingInstance_(), _doInstantiate_(), gum::prm::SVED< GUM_SCALAR >::_eliminateNodes_(), gum::prm::SVE< GUM_SCALAR >::_eliminateNodesWithEvidence_(), gum::prm::SVED< GUM_SCALAR >::_eliminateNodesWithEvidence_(), gum::prm::SVE< GUM_SCALAR >::_getAggTensor_(), gum::prm::SVED< GUM_SCALAR >::_getAggTensor_(), gum::prm::PRMSystem< GUM_SCALAR >::_groundRef_(), gum::prm::PRMSystem< double >::_groundTensor_(), gum::prm::InstanceBayesNet< GUM_SCALAR >::_init_(), gum::prm::StructuredInference< GUM_SCALAR >::_insertNodeInElimLists_(), gum::prm::StructuredBayesBall< GUM_SCALAR >::_isHardEvidence_(), gum::prm::StructuredInference< GUM_SCALAR >::_reduceAloneInstances_(), add(), gum::prm::o3prmr::O3prmrInterpreter::checkObserve(), gum::prm::o3prmr::O3prmrInterpreter::checkQuery(), and gum::prm::o3prmr::O3prmrInterpreter::checkUnobserve().

Here is the caller graph for this function:

◆ get() [2/4]

template<GUM_Numeric GUM_SCALAR>
const PRMAttribute< GUM_SCALAR > & gum::prm::PRMInstance< GUM_SCALAR >::get ( NodeId id) const

Getter on an PRMAttribute<GUM_SCALAR> of this PRMInstance<GUM_SCALAR>.

Recall that PRMAggregate<GUM_SCALAR> are instantiated has PRMAttribute<GUM_SCALAR> when an PRMInstance<GUM_SCALAR> is created. Thus any random variable contained in this PRMInstance<GUM_SCALAR> is mapped to an PRMAttribute<GUM_SCALAR>.

Parameters
idThe PRMAttribute<GUM_SCALAR> id.
Returns
Returns a constant reference on an PRMAttribute<GUM_SCALAR>.
Exceptions
NotFoundRaised if no PRMAttribute<GUM_SCALAR> matches name.

Definition at line 310 of file PRMInstance_tpl.h.

310 {
311 auto p = _nodeIdMap_.tryGet(id);
312 if (!p) GUM_ERROR(NotFound, "no PRMAttribute<GUM_SCALAR> with the given NodeId")
313 return *(*p);
314 }

References _nodeIdMap_, and GUM_ERROR.

◆ get() [3/4]

template<GUM_Numeric GUM_SCALAR>
PRMAttribute< GUM_SCALAR > & gum::prm::PRMInstance< GUM_SCALAR >::get ( std::string_view name)

Given a name returns the related PRMAttribute<GUM_SCALAR>.

Parameters
nameThe PRMAttribute<GUM_SCALAR>'s name.
Returns
Returns a reference over the PRMAttribute<GUM_SCALAR>.
Exceptions
NotFoundRaised if there is no PRMAttribute<GUM_SCALAR> named n.

Definition at line 317 of file PRMInstance_tpl.h.

317 {
318 if (!exists(name)) GUM_ERROR(NotFound, "no PRMAttribute<GUM_SCALAR> with the given name")
319 return *(_nodeIdMap_[type().get(name).id()]);
320 }

References _nodeIdMap_, exists(), GUM_ERROR, gum::prm::PRMObject::name(), and type().

Here is the call graph for this function:

◆ get() [4/4]

template<GUM_Numeric GUM_SCALAR>
const PRMAttribute< GUM_SCALAR > & gum::prm::PRMInstance< GUM_SCALAR >::get ( std::string_view name) const

Given a name returns the related PRMClassElement.

Parameters
nameThe PRMClassElement's name.
Returns
Returns a constant reference over the PRMClassElement.
Exceptions
NotFoundRaised if there is no PRMClassElement named n.

Definition at line 323 of file PRMInstance_tpl.h.

323 {
324 if (!exists(name)) GUM_ERROR(NotFound, "no PRMAttribute<GUM_SCALAR> with the given name")
325 return *(_nodeIdMap_[type().get(name).id()]);
326 }

References _nodeIdMap_, exists(), GUM_ERROR, gum::prm::PRMObject::name(), and type().

Here is the call graph for this function:

◆ getInstance()

template<GUM_Numeric GUM_SCALAR>
const PRMInstance< GUM_SCALAR > & gum::prm::PRMInstance< GUM_SCALAR >::getInstance ( NodeId id) const

Fast access to the first instance in a PRMReferenceSlot or PRMSlotChain<GUM_SCALAR>.

This is equivalent to **(this->getInstance(id).begin()) and should be use when dealing with non multiple PRMReferenceSlot or PRMSlotChain<GUM_SCALAR>.

Parameters
idThe NodeId of a PRMReferenceSlot or PRMSlotChain<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.
Exceptions
NotFoundRaised if there is no PRMClassElement given id.
UndefinedElementRaised if no PRMInstance<GUM_SCALAR> are referenced by id.

Definition at line 351 of file PRMInstance_tpl.h.

351 {
352 auto p = _referenceMap_.tryGet(id);
353 if (!p)
355 "no ReferenceSlot<GUM_SCALAR> or SlotChain<GUM_SCALAR> "
356 "matches the given NodeId")
357 if ((*p)->size() > 0) {
358 return **((*p)->begin());
359 } else {
360 GUM_ERROR(UndefinedElement, "no Instance associated with the given NodeId")
361 }
362 }

References PRMInstance(), _referenceMap_, and GUM_ERROR.

Here is the call graph for this function:

◆ getInstances()

template<GUM_Numeric GUM_SCALAR>
const Set< PRMInstance< GUM_SCALAR > * > & gum::prm::PRMInstance< GUM_SCALAR >::getInstances ( NodeId id) const

Returns the Set of PRMInstance<GUM_SCALAR> referenced by id.

Parameters
idThe NodeId of a PRMReferenceSlot or PRMSlotChain<GUM_SCALAR> in this.
Returns
Returns the Set of PRMInstance<GUM_SCALAR> referenced by id.
Exceptions
NotFoundIf there is no PRMClassElement given id.

Definition at line 366 of file PRMInstance_tpl.h.

366 {
367 auto p = _referenceMap_.tryGet(id);
368 if (!p)
370 "no ReferenceSlot<GUM_SCALAR> or SlotChain<GUM_SCALAR> "
371 "matches the given NodeId")
372 return *(*p);
373 }

References _referenceMap_, and GUM_ERROR.

Referenced by gum::prm::SVE< GUM_SCALAR >::_eliminateNodes_(), gum::prm::SVED< GUM_SCALAR >::_eliminateNodes_(), gum::prm::SVE< GUM_SCALAR >::_eliminateNodesDownward_(), gum::prm::SVED< GUM_SCALAR >::_eliminateNodesDownward_(), gum::prm::SVE< GUM_SCALAR >::_eliminateNodesUpward_(), gum::prm::SVED< GUM_SCALAR >::_eliminateNodesUpward_(), gum::prm::StructuredBayesBall< GUM_SCALAR >::_fromChild_(), and gum::prm::PRMSystem< GUM_SCALAR >::_groundRef_().

Here is the caller graph for this function:

◆ getRefAttr() [1/2]

template<GUM_Numeric GUM_SCALAR>
std::vector< std::pair< PRMInstance< GUM_SCALAR > *, std::string > > & gum::prm::PRMInstance< GUM_SCALAR >::getRefAttr ( NodeId id)

Returns a vector of pairs of refering attributes of id.

Definition at line 552 of file PRMInstance_tpl.h.

552 {
553 return *(_referingAttr_[id]);
554 }

References _referingAttr_.

Referenced by gum::prm::SVED< GUM_SCALAR >::_eliminateNodes_(), gum::prm::SVED< GUM_SCALAR >::_eliminateNodesDownward_(), gum::prm::SVED< GUM_SCALAR >::_eliminateNodesUpward_(), gum::prm::StructuredBayesBall< GUM_SCALAR >::_fromChild_(), gum::prm::StructuredBayesBall< GUM_SCALAR >::_fromParent_(), and gum::prm::StructuredInference< GUM_SCALAR >::_insertNodeInElimLists_().

Here is the caller graph for this function:

◆ getRefAttr() [2/2]

template<GUM_Numeric GUM_SCALAR>
const std::vector< std::pair< PRMInstance< GUM_SCALAR > *, std::string > > & gum::prm::PRMInstance< GUM_SCALAR >::getRefAttr ( NodeId id) const

Returns a vector of pairs of refering attributes of id.

Definition at line 558 of file PRMInstance_tpl.h.

558 {
559 return *(_referingAttr_[id]);
560 }

References _referingAttr_.

◆ hasRefAttr()

template<GUM_Numeric GUM_SCALAR>
bool gum::prm::PRMInstance< GUM_SCALAR >::hasRefAttr ( NodeId id) const

Returns true if id has at least one referring PRMAttribute<GUM_SCALAR>.

Parameters
idA NodeId.
Returns
returns true if is has at least one referring PRMAttribute<GUM_SCALAR>.

Definition at line 563 of file PRMInstance_tpl.h.

563 {
564 auto p = _referingAttr_.tryGet(id);
565 return p && (!(*p)->empty());
566 }

References _referingAttr_.

Referenced by gum::prm::SVED< GUM_SCALAR >::_eliminateNodes_(), gum::prm::SVED< GUM_SCALAR >::_eliminateNodesDownward_(), gum::prm::SVED< GUM_SCALAR >::_eliminateNodesUpward_(), gum::prm::StructuredBayesBall< GUM_SCALAR >::_fromChild_(), and gum::prm::StructuredBayesBall< GUM_SCALAR >::_fromParent_().

Here is the caller graph for this function:

◆ instantiate()

template<GUM_Numeric GUM_SCALAR>
void gum::prm::PRMInstance< GUM_SCALAR >::instantiate ( )

Instantiate all nodes which requires it.

All attributes are now instantiated, which means they have a different DiscreteVariable pointer. This methods however still connects attributes of different instance together.

Warning
Be aware that this method will delete a large part of this instance attribute's CPF. Furthermore, the instantiated attribute's type will change (but will not be deleted).

Definition at line 86 of file PRMInstance_tpl.h.

86 {
87 if (!_instantiated_) {
88 _instantiated_ = true;
90 }
91 }
void _doInstantiate_()
Starts this instance instantiations.

References _doInstantiate_(), and _instantiated_.

Here is the call graph for this function:

◆ isClass()

INLINE bool gum::prm::PRMObject::isClass ( const PRMObject & obj)
staticinherited

Returns true if obj_ptr is of type Class.

Definition at line 93 of file PRMObject_inl.h.

93 {
94 return obj.obj_type() == prm_type::CLASS;
95 }

References PRMObject().

Referenced by gum::prm::PRMClass< GUM_SCALAR >::scope(), and gum::prm::PRMFactory< GUM_SCALAR >::startAttribute().

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

◆ isInstance()

INLINE bool gum::prm::PRMObject::isInstance ( const PRMObject & obj)
staticinherited

Returns true if obj_ptr is of type PRMInstance.

Definition at line 101 of file PRMObject_inl.h.

101 {
102 return obj.obj_type() == prm_type::INSTANCE;
103 }

References PRMObject(), INSTANCE, and obj_type().

Here is the call graph for this function:

◆ isInterface()

INLINE bool gum::prm::PRMObject::isInterface ( const PRMObject & obj)
staticinherited

Returns true if obj_ptr is of type PRMInterface.

Definition at line 97 of file PRMObject_inl.h.

97 {
98 return obj.obj_type() == prm_type::PRM_INTERFACE;
99 }

◆ LEFT_CAST()

INLINE std::string gum::prm::PRMObject::LEFT_CAST ( )
staticinherited

Enumeration of the different types of objects handled by a PRM.

The "all" type is used to tell that we want any kind of PRMType (useful with iterators for example). No PRMObject will ever have "all" as type.

Definition at line 71 of file PRMObject_inl.h.

71{ return "("; }

Referenced by gum::prm::PRMAggregate< GUM_SCALAR >::PRMAggregate(), gum::prm::PRMAggregate< GUM_SCALAR >::PRMAggregate(), gum::prm::PRMFormAttribute< GUM_SCALAR >::PRMFormAttribute(), gum::prm::PRMReferenceSlot< GUM_SCALAR >::PRMReferenceSlot(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::PRMScalarAttribute(), gum::prm::PRMSlotChain< GUM_SCALAR >::PRMSlotChain(), gum::prm::PRMClassElement< GUM_SCALAR >::cast(), and gum::prm::decomposePath().

Here is the caller graph for this function:

◆ name() [1/2]

INLINE const std::string & gum::prm::PRMObject::name ( ) const
inherited

Returns the name of this object.

Definition at line 57 of file PRMObject_inl.h.

57{ return _name_; }
std::string _name_
Definition PRMObject.h:193

References _name_.

Referenced by gum::prm::PRMAggregate< GUM_SCALAR >::PRMAggregate(), gum::prm::PRMAggregate< GUM_SCALAR >::PRMAggregate(), gum::prm::PRMAttribute< GUM_SCALAR >::PRMAttribute(), gum::prm::PRMClass< GUM_SCALAR >::PRMClass(), gum::prm::PRMClass< GUM_SCALAR >::PRMClass(), gum::prm::PRMClass< GUM_SCALAR >::PRMClass(), gum::prm::PRMClass< GUM_SCALAR >::PRMClass(), gum::prm::PRMClassElement< GUM_SCALAR >::PRMClassElement(), gum::prm::PRMClassElement< GUM_SCALAR >::PRMClassElement(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::PRMClassElementContainer(), gum::prm::PRMFormAttribute< GUM_SCALAR >::PRMFormAttribute(), gum::prm::PRMFormAttribute< GUM_SCALAR >::PRMFormAttribute(), gum::prm::PRMFuncAttribute< GUM_SCALAR >::PRMFuncAttribute(), gum::prm::PRMInstance< GUM_SCALAR >::PRMInstance(), gum::prm::PRMInterface< GUM_SCALAR >::PRMInterface(), gum::prm::PRMInterface< GUM_SCALAR >::PRMInterface(), gum::prm::PRMInterface< GUM_SCALAR >::PRMInterface(), PRMObject(), gum::prm::PRMParameter< GUM_SCALAR >::PRMParameter(), gum::prm::PRMParameter< GUM_SCALAR >::PRMParameter(), gum::prm::PRMReferenceSlot< GUM_SCALAR >::PRMReferenceSlot(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::PRMScalarAttribute(), gum::prm::PRMSlotChain< GUM_SCALAR >::PRMSlotChain(), gum::prm::PRMSlotChain< GUM_SCALAR >::PRMSlotChain(), gum::prm::PRMSlotChain< GUM_SCALAR >::PRMSlotChain(), gum::prm::PRMSystem< GUM_SCALAR >::PRMSystem(), gum::prm::__print_attribute__(), gum::prm::__print_instance__(), gum::prm::SVE< GUM_SCALAR >::_addDelayedVariable_(), gum::prm::PRMClass< GUM_SCALAR >::_addIOInterfaceFlags_(), gum::prm::PRMFactory< GUM_SCALAR >::_addParent_(), gum::prm::PRMInstance< GUM_SCALAR >::_addReferingInstance_(), gum::prm::PRMClass< GUM_SCALAR >::_checkInterface_(), gum::prm::PRMFactory< GUM_SCALAR >::_checkInterfaceImplementation_(), gum::prm::PRMClass< GUM_SCALAR >::_checkInterfaces_(), gum::prm::o3prm::O3ClassFactory< GUM_SCALAR >::_checkRawCPT_(), gum::prm::PRMClass< GUM_SCALAR >::_checkRefInterface_(), gum::prm::PRMClass< GUM_SCALAR >::_checkRefInterfaces_(), gum::prm::o3prm::O3ClassFactory< GUM_SCALAR >::_checkRuleCPTSumsTo1_(), gum::prm::PRMInstance< GUM_SCALAR >::_copyAggregates_(), gum::prm::PRMInstance< GUM_SCALAR >::_copyAttribute_(), gum::prm::PRMSlotChain< GUM_SCALAR >::_copyLastElt_(), gum::prm::PRMSystem< GUM_SCALAR >::_groundAgg_(), gum::prm::PRMSystem< GUM_SCALAR >::_groundRef_(), gum::prm::PRMSystem< GUM_SCALAR >::_groundTensor_(), gum::prm::PRMSystem< double >::_groundTensor_(), gum::prm::PRMClass< GUM_SCALAR >::_inheritClass_(), gum::prm::PRMClass< GUM_SCALAR >::_overloadAttribute_(), gum::prm::PRMInterface< GUM_SCALAR >::_overloadAttribute_(), gum::prm::PRMClass< GUM_SCALAR >::_overloadParameter_(), gum::prm::PRMClass< GUM_SCALAR >::_overloadReference_(), gum::prm::PRMInterface< GUM_SCALAR >::_overloadReferenceSlot_(), gum::prm::gspan::StrictSearch< GUM_SCALAR >::_str_(), gum::prm::gspan::StrictSearch< GUM_SCALAR >::_str_(), gum::prm::gspan::StrictSearch< GUM_SCALAR >::_str_(), gum::prm::StructuredInference< GUM_SCALAR >::_str_(), gum::prm::StructuredInference< GUM_SCALAR >::_str_(), gum::prm::StructuredInference< GUM_SCALAR >::_str_(), gum::prm::PRMClass< GUM_SCALAR >::add(), gum::prm::PRMInterface< GUM_SCALAR >::add(), gum::prm::PRMSystem< GUM_SCALAR >::add(), gum::prm::PRMFactory< GUM_SCALAR >::addAggregator(), gum::prm::PRMFormAttribute< GUM_SCALAR >::addParent(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::addParent(), gum::prm::PRMClassElement< GUM_SCALAR >::cast(), gum::prm::PRMClass< GUM_SCALAR >::completeInheritance(), gum::prm::PRMFormAttribute< GUM_SCALAR >::copy(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::copy(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::exists(), gum::prm::PRMInstance< GUM_SCALAR >::exists(), gum::prm::PRMSystem< GUM_SCALAR >::exists(), gum::prm::o3prmr::O3prmrInterpreter::findAttributeName(), gum::prm::o3prmr::O3prmrInterpreter::findInstanceName(), gum::prm::PRMClass< GUM_SCALAR >::get(), gum::prm::PRMClass< GUM_SCALAR >::get(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::get(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::get(), gum::prm::PRMInstance< GUM_SCALAR >::get(), gum::prm::PRMInstance< GUM_SCALAR >::get(), gum::prm::PRMInterface< GUM_SCALAR >::get(), gum::prm::PRMInterface< GUM_SCALAR >::get(), gum::prm::PRMSystem< GUM_SCALAR >::get(), gum::prm::PRMSystem< GUM_SCALAR >::get(), gum::prm::PRMSystem< GUM_SCALAR >::getArray(), gum::prm::PRMSystem< GUM_SCALAR >::getArrayType(), gum::prm::PRMSystem< GUM_SCALAR >::getArrayType(), gum::prm::PRMAggregate< GUM_SCALAR >::getCastDescendant(), gum::prm::PRMFormAttribute< GUM_SCALAR >::getCastDescendant(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::getCastDescendant(), gum::prm::PRMSystem< GUM_SCALAR >::groundedBN(), gum::prm::PRMClass< GUM_SCALAR >::inheritAggregates(), gum::prm::PRMSystem< GUM_SCALAR >::isArray(), gum::prm::PRMClass< GUM_SCALAR >::isCastDescendant(), gum::prm::PRMSystem< GUM_SCALAR >::isInstance(), name(), gum::prm::PRMType::name(), gum::prm::PRMFormAttribute< GUM_SCALAR >::newFactory(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::newFactory(), operator!=(), operator<<(), gum::prm::PRMClass< GUM_SCALAR >::operator=(), operator==(), gum::prm::PRMType::operator==(), gum::prm::PRMClass< GUM_SCALAR >::operator[](), gum::prm::PRMClass< GUM_SCALAR >::operator[](), gum::prm::PRMClassElementContainer< GUM_SCALAR >::operator[](), gum::prm::PRMClassElementContainer< GUM_SCALAR >::operator[](), gum::prm::PRMInterface< GUM_SCALAR >::operator[](), gum::prm::PRMInterface< GUM_SCALAR >::operator[](), gum::prm::PRMClass< GUM_SCALAR >::overload(), gum::prm::PRMInterface< GUM_SCALAR >::overload(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::PRMClassElementContainterConstIterator, gum::prm::PRMFormAttribute< GUM_SCALAR >::setAsCastDescendant(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::setAsCastDescendant(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::setInputNode(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::setOutputNode(), gum::prm::PRMFactory< GUM_SCALAR >::startClass(), gum::prm::PRMFactory< GUM_SCALAR >::startInterface(), and gum::prm::PRMFactory< GUM_SCALAR >::startSystem().

◆ name() [2/2]

INLINE void gum::prm::PRMObject::name ( std::string_view name)
inherited

Change the name of the PRM Object.

Warning
Don't do this unless you know what you are doing !

Definition at line 61 of file PRMObject_inl.h.

61{ _name_ = name; }

References _name_, and name().

Here is the call graph for this function:

◆ obj_type()

template<GUM_Numeric GUM_SCALAR>
PRMObject::prm_type gum::prm::PRMInstance< GUM_SCALAR >::obj_type ( ) const
overridevirtual

Returns the PRM type of this object.

Implements gum::prm::PRMObject.

Definition at line 278 of file PRMInstance_tpl.h.

278 {
280 }

References gum::prm::PRMObject::INSTANCE.

◆ operator!=()

INLINE bool gum::prm::PRMObject::operator!= ( const PRMObject & obj) const
inherited

To PRMObject are equal if they have the same name (which is unique).

Definition at line 69 of file PRMObject_inl.h.

69{ return _name_ != obj.name(); }

References PRMObject(), _name_, and name().

Here is the call graph for this function:

◆ operator=()

template<GUM_Numeric GUM_SCALAR>
PRMInstance< GUM_SCALAR > & gum::prm::PRMInstance< GUM_SCALAR >::operator= ( const PRMClass< GUM_SCALAR > & from)
private

Copy operator. Don't use it.

Definition at line 273 of file PRMInstance_tpl.h.

273 {
274 GUM_ERROR(FatalError, "do not copy Instance")
275 }

References GUM_ERROR.

◆ operator==()

INLINE bool gum::prm::PRMObject::operator== ( const PRMObject & obj) const
inherited

To PRMObject are equal if they have the same name (which is unique).

Definition at line 65 of file PRMObject_inl.h.

65{ return _name_ == obj.name(); }

References PRMObject(), _name_, and name().

Here is the call graph for this function:

◆ RIGHT_CAST()

INLINE std::string gum::prm::PRMObject::RIGHT_CAST ( )
staticinherited

Enumeration of the different types of objects handled by a PRM.

The "all" type is used to tell that we want any kind of PRMType (useful with iterators for example). No PRMObject will ever have "all" as type.

Definition at line 73 of file PRMObject_inl.h.

73{ return ")"; }

Referenced by gum::prm::PRMAggregate< GUM_SCALAR >::PRMAggregate(), gum::prm::PRMAggregate< GUM_SCALAR >::PRMAggregate(), gum::prm::PRMFormAttribute< GUM_SCALAR >::PRMFormAttribute(), gum::prm::PRMReferenceSlot< GUM_SCALAR >::PRMReferenceSlot(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::PRMScalarAttribute(), gum::prm::PRMSlotChain< GUM_SCALAR >::PRMSlotChain(), gum::prm::PRMClassElement< GUM_SCALAR >::cast(), and gum::prm::decomposePath().

Here is the caller graph for this function:

◆ size()

template<GUM_Numeric GUM_SCALAR>
Size gum::prm::PRMInstance< GUM_SCALAR >::size ( ) const

Returns the number of attributes in this PRMInstance<GUM_SCALAR>.

Returns
the number of attributes in this PRMInstance<GUM_SCALAR>.

Definition at line 238 of file PRMInstance_tpl.h.

238 {
239 return _nodeIdMap_.size();
240 }

References _nodeIdMap_.

Referenced by _instantiateSlotChain_(), and gum::prm::StructuredInference< GUM_SCALAR >::_reduceAloneInstances_().

Here is the caller graph for this function:

◆ type() [1/2]

template<GUM_Numeric GUM_SCALAR>
PRMClass< GUM_SCALAR > & gum::prm::PRMInstance< GUM_SCALAR >::type ( )

Returns the type of this instance.

Definition at line 283 of file PRMInstance_tpl.h.

283 {
284 return *_type_;
285 }

References _type_.

Referenced by PRMInstance(), gum::prm::__print_attribute__(), gum::prm::__print_instance__(), gum::prm::StructuredBayesBall< GUM_SCALAR >::_buildHashKey_(), gum::prm::SVE< GUM_SCALAR >::_checkElimOrder_(), gum::prm::SVED< GUM_SCALAR >::_checkElimOrder_(), _copyAttributeCPF_(), _doInstantiate_(), gum::prm::SVE< GUM_SCALAR >::_eliminateNodes_(), gum::prm::SVE< GUM_SCALAR >::_eliminateNodesDownward_(), gum::prm::SVED< GUM_SCALAR >::_eliminateNodesDownward_(), gum::prm::SVE< GUM_SCALAR >::_eliminateNodesUpward_(), gum::prm::SVED< GUM_SCALAR >::_eliminateNodesUpward_(), gum::prm::SVE< GUM_SCALAR >::_eliminateNodesWithEvidence_(), gum::prm::StructuredBayesBall< GUM_SCALAR >::_fromChild_(), gum::prm::StructuredBayesBall< GUM_SCALAR >::_fromParent_(), gum::prm::StructuredBayesBall< GUM_SCALAR >::_getSC_(), gum::prm::PRMSystem< GUM_SCALAR >::_groundAttr_(), gum::prm::PRMSystem< GUM_SCALAR >::_groundRef_(), gum::prm::PRMSystem< double >::_groundTensor_(), gum::prm::InstanceBayesNet< GUM_SCALAR >::_init_(), gum::prm::SVED< GUM_SCALAR >::_initLiftedNodes_(), gum::prm::SVED< GUM_SCALAR >::_initReqSets_(), gum::prm::SVE< GUM_SCALAR >::_insertLiftedNodes_(), gum::prm::StructuredInference< GUM_SCALAR >::_insertNodeInElimLists_(), gum::prm::StructuredInference< GUM_SCALAR >::_reduceAloneInstances_(), gum::prm::SVE< GUM_SCALAR >::_variableElimination_(), add(), gum::prm::PRMSystem< GUM_SCALAR >::add(), get(), and get().

◆ type() [2/2]

template<GUM_Numeric GUM_SCALAR>
const PRMClass< GUM_SCALAR > & gum::prm::PRMInstance< GUM_SCALAR >::type ( ) const

Returns the type of this instance.

Definition at line 288 of file PRMInstance_tpl.h.

288 {
289 return *_type_;
290 }

References _type_.

Member Data Documentation

◆ _bijection_

template<GUM_Numeric GUM_SCALAR>
Bijection< const DiscreteVariable*, const DiscreteVariable* > gum::prm::PRMInstance< GUM_SCALAR >::_bijection_
private

A bijection used for MultiDim handling.

Definition at line 538 of file PRMInstance.h.

Referenced by _copyAggregates_(), _copyAttribute_(), _instantiateSlotChain_(), and bijection().

◆ _instantiated_

template<GUM_Numeric GUM_SCALAR>
bool gum::prm::PRMInstance< GUM_SCALAR >::_instantiated_
private

True if this instance has been instantiated.

Definition at line 516 of file PRMInstance.h.

Referenced by PRMInstance(), and instantiate().

◆ _name_

std::string gum::prm::PRMObject::_name_
privateinherited

Definition at line 193 of file PRMObject.h.

Referenced by PRMObject(), PRMObject(), PRMObject(), name(), name(), operator!=(), operator=(), and operator==().

◆ _nodeIdMap_

template<GUM_Numeric GUM_SCALAR>
NodeProperty< PRMAttribute< GUM_SCALAR >* > gum::prm::PRMInstance< GUM_SCALAR >::_nodeIdMap_
private

◆ _referenceMap_

template<GUM_Numeric GUM_SCALAR>
NodeProperty< Set< PRMInstance< GUM_SCALAR >* >* > gum::prm::PRMInstance< GUM_SCALAR >::_referenceMap_
private

Mapping between the gum::prm::PRMReferenceSlot and gum::prm::PRMSlotChain<GUM_SCALAR> in type / and the PRMInstance<GUM_SCALAR> associated with it.

Definition at line 528 of file PRMInstance.h.

Referenced by ~PRMInstance(), _addReferingInstance_(), _doInstantiate_(), _instantiateSlotChain_(), add(), begin(), begin(), getInstance(), and getInstances().

◆ _referingAttr_

template<GUM_Numeric GUM_SCALAR>
NodeProperty< std::vector< pair >* > gum::prm::PRMInstance< GUM_SCALAR >::_referingAttr_
private

The set of pair (instance, attribute) referring an attribute of this instance.

Definition at line 535 of file PRMInstance.h.

Referenced by ~PRMInstance(), _addReferingInstance_(), beginInvRef(), beginInvRef(), endInvRef(), endInvRef(), getRefAttr(), getRefAttr(), and hasRefAttr().

◆ _type_

template<GUM_Numeric GUM_SCALAR>
PRMClass< GUM_SCALAR >* gum::prm::PRMInstance< GUM_SCALAR >::_type_
private

The type of this PRMInstance<GUM_SCALAR>.

Definition at line 519 of file PRMInstance.h.

Referenced by PRMInstance(), PRMInstance(), exists(), type(), and type().


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