aGrUM 3.3.2
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 >:
[legend]
Collaboration diagram for gum::prm::PRMInstance< GUM_SCALAR >:
[legend]

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 iterator & end ()
 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_iterator & 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>.
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 InvRefIterator & endInvRef ()
 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 InvRefConstIterator & endInvRef () 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(), gum::prm::PRMFactory< GUM_SCALAR >::_addInstance_(), _addReferingInstance_(), add(), gum::prm::PRMFactory< GUM_SCALAR >::addArray(), 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 273 of file PRMInstance_tpl.h.

273 :
276 GUM_ERROR(FatalError, "do not copy Instance")
277 }

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 337 of file PRMInstance_tpl.h.

338 {
339 NodeId id = i->get(sc->lastElt().safeName()).id();
340 std::string name = sc->name();
341
342 auto p_rm = i->_referenceMap_.tryGet(id);
343 if (!p_rm) {
344 i->_referenceMap_.insert(id, new Set< PRMInstance< GUM_SCALAR >* >());
345 i->_referingAttr_.insert(id, new std::vector< pair >());
346 p_rm = i->_referenceMap_.tryGet(id);
347 }
348 (*p_rm)->insert(this);
349 (*i->_referingAttr_.tryGet(id))->push_back(std::make_pair(this, name));
350 }
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 251 of file PRMInstance_tpl.h.

251 {
253 source->type(),
254 source->buildImpl());
255 GUM_ASSERT(&(attr->type().variable()) != &(source->type().variable()));
256 attr->setId(source->id());
257 _nodeIdMap_.insert(attr->id(), attr);
258 _bijection_.insert(&(source->type().variable()), &(attr->type().variable()));
259 }
Bijection< const DiscreteVariable *, const DiscreteVariable * > _bijection_
A bijection used for MultiDim handling.
PRMScalarAttribute(std::string_view name, const PRMType &type, MultiDimImplementation< GUM_SCALAR > *impl=new MultiDimArray< GUM_SCALAR >())
Constructor used by gum::Class.

References gum::prm::PRMScalarAttribute< GUM_SCALAR >::PRMScalarAttribute(), _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 262 of file PRMInstance_tpl.h.

262 {
264 GUM_ASSERT(&(attr->type().variable()) != &(source->type().variable()));
265 // The tensor is copied when instantiate() is called
266 attr->cpf().fill((GUM_SCALAR)0);
267 attr->setId(source->id());
268 _bijection_.insert(&(source->type().variable()), &(attr->type().variable()));
269 _nodeIdMap_.insert(attr->id(), attr);
270 }

References gum::prm::PRMScalarAttribute< GUM_SCALAR >::PRMScalarAttribute(), _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 577 of file PRMInstance_tpl.h.

577 {
578 const auto& type_attr
579 = static_cast< const PRMAttribute< GUM_SCALAR >& >(type().get(attr->safeName()));
580 try {
581 attr->copyCpf(bijection(), type_attr);
582 } catch (NotFound const&) {
583 // a parent reached through a reference slot is missing from the bijection
585 "cannot build the CPT of " << name() << "." << attr->name()
586 << ": a reference slot of " << name()
587 << " is probably not assigned")
588 }
589 GUM_ASSERT(attr->cpf().contains(attr->type().variable()));
590 }
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_ERROR, gum::prm::PRMObject::name(), 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 auto p_next = current->_referenceMap_.tryGet(ref.id());
139 if (!p_next) {
140 delete temp;
141 delete set;
143 "the reference slot " << ref.name() << " of " << current->name()
144 << " is not assigned")
145 }
146 for (auto next: *(*p_next)) {
147 temp->insert(next);
148 }
149 }
150 delete set;
151 set = temp;
152 }
153
154 GUM_ASSERT(set->size() > 0);
155 // set contains all the instances references by sc
156 if (auto p_ref = _referenceMap_.tryGet(sc->id())) {
157 delete *p_ref;
158 *p_ref = set;
159 } else {
160 _referenceMap_.insert(sc->id(), set);
161 }
162
163 // Add refering instances
164 for (auto i: *set) {
166 }
167
168 // If sc is not multiple so it can be added as a parent of an attribute
169 if (!sc->isMultiple()) {
170 // We should have only one instance
171 // Less ugly way to get the single instance in set
172 for (auto instance: *set) {
173 auto& attr = instance->get(sc->lastElt().safeName());
174 _bijection_.insert(&(sc->type().variable()), &(attr.type().variable()));
175 }
176 }
177 }
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_ERROR, 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 180 of file PRMInstance_tpl.h.

180 {
181 if (!type().exists(id))
182 GUM_ERROR(NotFound, "no ClassElement<GUM_SCALAR> matches the given id")
183 PRMClassElement< GUM_SCALAR >* elt = &(type().get(id));
184
185 switch (elt->elt_type()) {
188
189 // Checking if instance's type is legal
190 if (!instance.type().isSubTypeOf(ref->slotType())) {
192 "given Instance type is not a proper "
193 "subclass of the ReferenceSlot<GUM_SCALAR> slot type");
194 }
195
196 // Checking the reference's size limit
197 if (auto p_ref_slot = _referenceMap_.tryGet(id);
199 && (!static_cast< PRMReferenceSlot< GUM_SCALAR >& >(type().get(id)).isArray())
200 && ((*p_ref_slot)->size() == 1)) {
201 GUM_ERROR(OutOfBounds, "ReferenceSlot<GUM_SCALAR> size limit reached")
202 }
203
204 break;
205 }
206
209 = static_cast< PRMSlotChain< GUM_SCALAR >& >(type().get(id));
210
211 // Checking if instance's type is legal
212 if (!instance.type().isSubTypeOf(sc.end())) {
214 "given Instance type is not a proper "
215 "subclass of the ClassElementContainer pointed"
216 " by the SlotChain<GUM_SCALAR>");
217 }
218
219 // Checking the reference's size limit
220 if (auto p_ref_sc = _referenceMap_.tryGet(id);
221 p_ref_sc && (!static_cast< PRMSlotChain< GUM_SCALAR >& >(type().get(id)).isMultiple())
222 && ((*p_ref_sc)->size() == 1)) {
223 GUM_ERROR(OutOfBounds, "SlotChain<GUM_SCALAR> size limit reached")
224 }
225
226 break;
227 }
228
229 default : {
230 if (!type().isOutputNode(*elt)) {
231 GUM_ERROR(WrongClassElement, "given ClassElement<GUM_SCALAR> is not an output node")
232 }
233 }
234 }
235
236 auto p_ref_add = _referenceMap_.tryGet(id);
237 if (!p_ref_add) {
238 _referenceMap_.insert(id, new Set< PRMInstance< GUM_SCALAR >* >());
239 p_ref_add = _referenceMap_.tryGet(id);
240 }
241
242 (*p_ref_add)->insert(&instance);
243 }
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 384 of file PRMInstance_tpl.h.

384 {
385 return _nodeIdMap_.begin();
386 }

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 394 of file PRMInstance_tpl.h.

394 {
395 return _nodeIdMap_.begin();
396 }

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 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.

◆ 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 413 of file PRMInstance_tpl.h.

413 {
414 auto p = _referenceMap_.tryGet(id);
415 if (!p) GUM_ERROR(NotFound, "no referred instances from this NodeId")
417 }
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 536 of file PRMInstance_tpl.h.

536 {
537 return _referingAttr_.begin();
538 }

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 548 of file PRMInstance_tpl.h.

548 {
549 return _referingAttr_.begin();
550 }

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 354 of file PRMInstance_tpl.h.

354 {
355 return _bijection_;
356 }

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 389 of file PRMInstance_tpl.h.

389 {
390 return _nodeIdMap_.end();
391 }

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 400 of file PRMInstance_tpl.h.

400 {
401 return _nodeIdMap_.end();
402 }

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 542 of file PRMInstance_tpl.h.

542 {
543 return _referingAttr_.end();
544 }

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 554 of file PRMInstance_tpl.h.

554 {
555 return _referingAttr_.end();
556 }

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 301 of file PRMInstance_tpl.h.

301 {
302 return _nodeIdMap_.exists(id);
303 }

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 306 of file PRMInstance_tpl.h.

306 {
307 return _type_->exists(name) && exists(_type_->get(name).id());
308 }

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 311 of file PRMInstance_tpl.h.

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

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 318 of file PRMInstance_tpl.h.

318 {
319 auto p = _nodeIdMap_.tryGet(id);
320 if (!p) GUM_ERROR(NotFound, "no PRMAttribute<GUM_SCALAR> with the given NodeId")
321 return *(*p);
322 }

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 325 of file PRMInstance_tpl.h.

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

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 331 of file PRMInstance_tpl.h.

331 {
332 if (!exists(name)) GUM_ERROR(NotFound, "no PRMAttribute<GUM_SCALAR> with the given name")
333 return *(_nodeIdMap_[type().get(name).id()]);
334 }

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 359 of file PRMInstance_tpl.h.

359 {
360 auto p = _referenceMap_.tryGet(id);
361 if (!p)
363 "no ReferenceSlot<GUM_SCALAR> or SlotChain<GUM_SCALAR> "
364 "matches the given NodeId")
365 if ((*p)->size() > 0) {
366 return **((*p)->begin());
367 } else {
368 GUM_ERROR(UndefinedElement, "no Instance associated with the given NodeId")
369 }
370 }

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 374 of file PRMInstance_tpl.h.

374 {
375 auto p = _referenceMap_.tryGet(id);
376 if (!p)
378 "no ReferenceSlot<GUM_SCALAR> or SlotChain<GUM_SCALAR> "
379 "matches the given NodeId")
380 return *(*p);
381 }

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 560 of file PRMInstance_tpl.h.

560 {
561 return *(_referingAttr_[id]);
562 }

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 566 of file PRMInstance_tpl.h.

566 {
567 return *(_referingAttr_[id]);
568 }

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 571 of file PRMInstance_tpl.h.

571 {
572 auto p = _referingAttr_.tryGet(id);
573 return p && (!(*p)->empty());
574 }

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::PRMInstance< GUM_SCALAR >::_copyAttributeCPF_(), 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 286 of file PRMInstance_tpl.h.

286 {
288 }

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().

Referenced by obj_type().

Here is the call graph for this function:
Here is the caller 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 281 of file PRMInstance_tpl.h.

281 {
282 GUM_ERROR(FatalError, "do not copy Instance")
283 }

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().

Referenced by obj_type().

Here is the call graph for this function:
Here is the caller 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 246 of file PRMInstance_tpl.h.

246 {
247 return _nodeIdMap_.size();
248 }

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 291 of file PRMInstance_tpl.h.

291 {
292 return *_type_;
293 }

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 296 of file PRMInstance_tpl.h.

296 {
297 return *_type_;
298 }

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: