aGrUM  0.16.0
PRMInstance_tpl.h
Go to the documentation of this file.
1 
31 
33 
34 namespace gum {
35  namespace prm {
36  template < typename GUM_SCALAR >
37  PRMInstance< GUM_SCALAR >::PRMInstance(const std::string& name,
38  PRMClass< GUM_SCALAR >& type) :
39  PRMObject(name),
40  __instantiated(false), __type(&type) {
41  GUM_CONSTRUCTOR(PRMInstance);
42 
43  // First we create attributes for each aggregate in type
44  for (const auto agg : __type->aggregates())
45  __copyAggregates(agg);
46 
47  // We add attributes in type by reference for inner ones and by copy for
48  // output ones
49  for (const auto attr : __type->attributes())
50  __copyAttribute(attr);
51  }
52 
53  template < typename GUM_SCALAR >
55  GUM_DESTRUCTOR(PRMInstance);
56 
57  for (const auto& elt : __nodeIdMap)
58  delete elt.second;
59 
60  for (const auto& elt : __referenceMap)
61  delete elt.second;
62 
63  for (const auto& elt : __referingAttr)
64  delete elt.second;
65  }
66 
67  template < typename GUM_SCALAR >
69  if (!__instantiated) {
70  __instantiated = true;
72  }
73  }
74 
75  template < typename GUM_SCALAR >
77  // First retrieving any referenced instance
78  for (const auto chain : type().slotChains()) {
80  }
81 
82  // Now we need to add referred instance to each input node
83  // For Attributes we first add parents, then we initialize CPF
84  for (const auto attr : type().attributes()) {
85  __copyAttributeCPF(__nodeIdMap[(*attr).id()]);
86  }
87 
88  // For PRMAggregate<GUM_SCALAR> we add parents
89  for (const auto agg : type().aggregates()) {
90  PRMAttribute< GUM_SCALAR >& attr = get(agg->safeName());
91 
92  for (const auto node : type().containerDag().parents(agg->id())) {
93  try {
94  attr.addParent(get(node));
95  } catch (NotFound&) {
96  auto elt = &(type().get(node));
97  auto sc = static_cast< PRMSlotChain< GUM_SCALAR >* >(elt);
98  const auto& instances = getInstances(sc->id());
99 
100  for (const auto inst : instances) {
101  attr.addParent(inst->get(sc->lastElt().safeName()));
102  }
103  }
104  }
105  }
106  }
107 
108  template < typename GUM_SCALAR >
111  auto first_id = sc->chain()[0]->id();
112  auto set =
113  new Set< PRMInstance< GUM_SCALAR >* >(*(__referenceMap[first_id]));
114  // We proceed with a width-first run of the slot chain
115  for (Size idx = 1; idx < sc->chain().size() - 1; ++idx) {
116  auto temp = new Set< PRMInstance< GUM_SCALAR >* >();
117  for (auto current : *set) {
118  auto& ref = current->type().get(sc->chain()[idx]->name());
119  for (auto next : *(current->__referenceMap[ref.id()])) {
120  temp->insert(next);
121  }
122  }
123  delete set;
124  set = temp;
125  }
126 
127  GUM_ASSERT(set->size() > 0);
128  // set contains all the instances references by sc
129  if (__referenceMap.exists(sc->id())) {
130  delete __referenceMap[sc->id()];
131  __referenceMap[sc->id()] = set;
132  } else {
133  __referenceMap.insert(sc->id(), set);
134  }
135 
136  // Add refering instances
137  for (auto i : *set) {
138  __addReferingInstance(sc, i);
139  }
140 
141  // If sc is not multiple so it can be added as a parent of an attribute
142  if (!sc->isMultiple()) {
143  // We should have only one instance
144  // Less ugly way to get the single instance in set
145  for (auto instance : *set) {
146  auto& attr = instance->get(sc->lastElt().safeName());
147  __bijection.insert(&(sc->type().variable()), &(attr.type().variable()));
148  }
149  }
150  }
151 
152  template < typename GUM_SCALAR >
154  PRMInstance< GUM_SCALAR >& instance) {
156 
157  try {
158  elt = &(type().get(id));
159  } catch (NotFound&) {
160  GUM_ERROR(NotFound, "no ClassElement<GUM_SCALAR> matches the given id");
161  }
162 
163  switch (elt->elt_type()) {
166  static_cast< PRMReferenceSlot< GUM_SCALAR >* >(elt);
167 
168  // Checking if instance's type is legal
169  if (!instance.type().isSubTypeOf(ref->slotType())) {
171  "given Instance type is not a proper "
172  "subclass of the ReferenceSlot<GUM_SCALAR> slot type");
173  }
174 
175  // Checking the reference's size limit
176  if (__referenceMap.exists(id)
177  && (!static_cast< PRMReferenceSlot< GUM_SCALAR >& >(type().get(id))
178  .isArray())
179  && (__referenceMap[id]->size() == 1)) {
181  "ReferenceSlot<GUM_SCALAR> size limit reached");
182  }
183 
184  break;
185  }
186 
189  static_cast< PRMSlotChain< GUM_SCALAR >& >(type().get(id));
190 
191  // Checking if instance's type is legal
192  if (!instance.type().isSubTypeOf(sc.end())) {
194  "given Instance type is not a proper "
195  "subclass of the ClassElementContainer pointed"
196  " by the SlotChain<GUM_SCALAR>");
197  }
198 
199  // Checking the reference's size limit
200  if (__referenceMap.exists(id)
201  && (!static_cast< PRMSlotChain< GUM_SCALAR >& >(type().get(id))
202  .isMultiple())
203  && (__referenceMap[id]->size() == 1)) {
204  GUM_ERROR(OutOfUpperBound, "SlotChain<GUM_SCALAR> size limit reached");
205  }
206 
207  break;
208  }
209 
210  default: {
211  if (!type().isOutputNode(*elt)) {
213  "given ClassElement<GUM_SCALAR> is not an output node");
214  }
215  }
216  }
217 
218  if (!__referenceMap.exists(id)) {
219  __referenceMap.insert(id, new Set< PRMInstance< GUM_SCALAR >* >());
220  }
221 
222  __referenceMap[id]->insert(&instance);
223  }
224 
225  template < typename GUM_SCALAR >
227  return __nodeIdMap.size();
228  }
229 
230  template < typename GUM_SCALAR >
232  PRMAggregate< GUM_SCALAR >* source) {
233  auto attr = new PRMScalarAttribute< GUM_SCALAR >(
234  source->name(), source->type(), source->buildImpl());
235  GUM_ASSERT(&(attr->type().variable()) != &(source->type().variable()));
236  attr->setId(source->id());
237  __nodeIdMap.insert(attr->id(), attr);
238  __bijection.insert(&(source->type().variable()), &(attr->type().variable()));
239  }
240 
241  template < typename GUM_SCALAR >
243  PRMAttribute< GUM_SCALAR >* source) {
244  auto attr =
245  new PRMScalarAttribute< GUM_SCALAR >(source->name(), source->type());
246  GUM_ASSERT(&(attr->type().variable()) != &(source->type().variable()));
247  // The potential is copied when instantiate() is called
248  attr->cpf().fill((GUM_SCALAR)0);
249  attr->setId(source->id());
250  __bijection.insert(&(source->type().variable()), &(attr->type().variable()));
251  __nodeIdMap.insert(attr->id(), attr);
252  }
253 
254  template < typename GUM_SCALAR >
256  const PRMInstance< GUM_SCALAR >& source) :
257  PRMObject(source),
258  __type(source.__type) {
259  GUM_CONS_CPY(PRMInstance);
260  GUM_ERROR(FatalError, "do not copy Instance");
261  }
262 
263  template < typename GUM_SCALAR >
266  GUM_ERROR(FatalError, "do not copy Instance");
267  }
268 
269  template < typename GUM_SCALAR >
272  }
273 
274  template < typename GUM_SCALAR >
276  return *__type;
277  }
278 
279  template < typename GUM_SCALAR >
281  return *__type;
282  }
283 
284  template < typename GUM_SCALAR >
286  return __nodeIdMap.exists(id);
287  }
288 
289  template < typename GUM_SCALAR >
290  INLINE bool PRMInstance< GUM_SCALAR >::exists(const std::string& name) const {
291  return __type->exists(name) && exists(__type->get(name).id());
292  }
293 
294  template < typename GUM_SCALAR >
296  try {
297  return *(__nodeIdMap[id]);
298  } catch (NotFound&) {
299  GUM_ERROR(NotFound, "no PRMAttribute<GUM_SCALAR> with the given NodeId");
300  }
301  }
302 
303  template < typename GUM_SCALAR >
304  INLINE const PRMAttribute< GUM_SCALAR >&
306  try {
307  return *(__nodeIdMap[id]);
308  } catch (NotFound&) {
309  GUM_ERROR(NotFound, "no PRMAttribute<GUM_SCALAR> with the given NodeId");
310  }
311  }
312 
313  template < typename GUM_SCALAR >
315  PRMInstance< GUM_SCALAR >::get(const std::string& name) {
316  try {
317  return *(__nodeIdMap[type().get(name).id()]);
318  } catch (NotFound&) {
319  GUM_ERROR(NotFound, "no PRMAttribute<GUM_SCALAR> with the given name");
320  }
321  }
322 
323  template < typename GUM_SCALAR >
324  INLINE const PRMAttribute< GUM_SCALAR >&
325  PRMInstance< GUM_SCALAR >::get(const std::string& name) const {
326  try {
327  return *(__nodeIdMap[type().get(name).id()]);
328  } catch (NotFound&) {
329  GUM_ERROR(NotFound, "no PRMAttribute<GUM_SCALAR> with the given name");
330  }
331  }
332 
333  template < typename GUM_SCALAR >
336  NodeId id = i->get(sc->lastElt().safeName()).id();
337  std::string name = sc->lastElt().safeName();
338 
339  try {
340  i->__referenceMap[id]->insert(this);
341  i->__referingAttr[id]->push_back(
342  std::make_pair(this, sc->lastElt().safeName()));
343  } catch (NotFound&) {
344  i->__referenceMap.insert(id, new Set< PRMInstance< GUM_SCALAR >* >());
345  i->__referenceMap[id]->insert(this);
346  i->__referingAttr.insert(id, new std::vector< pair >());
347  i->__referingAttr[id]->push_back(
348  std::make_pair(this, sc->lastElt().safeName()));
349  }
350  }
351 
352  template < typename GUM_SCALAR >
355  return __bijection;
356  }
357 
358  template < typename GUM_SCALAR >
359  INLINE const PRMInstance< GUM_SCALAR >&
361  try {
362  if (__referenceMap[id]->size() > 0) {
363  return **(__referenceMap[id]->begin());
364  } else {
366  "no Instance associated with the given NodeId");
367  }
368  } catch (NotFound&) {
370  "no ReferenceSlot<GUM_SCALAR> or SlotChain<GUM_SCALAR> "
371  "matches the given NodeId");
372  }
373  }
374 
375  template < typename GUM_SCALAR >
376  INLINE const Set< PRMInstance< GUM_SCALAR >* >&
378  try {
379  return *(__referenceMap[id]);
380  } catch (NotFound&) {
382  "no ReferenceSlot<GUM_SCALAR> or SlotChain<GUM_SCALAR> "
383  "matches the given NodeId");
384  }
385  }
386 
387  template < typename GUM_SCALAR >
390  return __nodeIdMap.begin();
391  }
392 
393  template < typename GUM_SCALAR >
394  INLINE const typename PRMInstance< GUM_SCALAR >::iterator&
396  return __nodeIdMap.end();
397  }
398 
399  template < typename GUM_SCALAR >
402  return __nodeIdMap.begin();
403  }
404 
405  template < typename GUM_SCALAR >
406  INLINE const typename PRMInstance< GUM_SCALAR >::const_iterator&
408  return __nodeIdMap.end();
409  }
410 
411  template < typename GUM_SCALAR >
414  try {
416  } catch (NotFound&) {
417  GUM_ERROR(NotFound, "no referred instances from this NodeId");
418  }
419  }
420 
421  template < typename GUM_SCALAR >
424  try {
426  } catch (NotFound&) {
427  GUM_ERROR(NotFound, "no referred instances from this NodeId");
428  }
429  }
430 
431  template < typename GUM_SCALAR >
433  Set< PRMInstance< GUM_SCALAR >* >& set) :
434  __set(set),
435  __iter(set.begin()) {
437  }
438 
439  template < typename GUM_SCALAR >
441  const RefIterator& from) :
442  __set(const_cast< Set< PRMInstance< GUM_SCALAR >* >& >(from.__set)),
443  __iter(from.__iter) {
445  }
446 
447  template < typename GUM_SCALAR >
450  }
451 
452  template < typename GUM_SCALAR >
455  __iter = from.__iter;
456  return *this;
457  }
458 
459  template < typename GUM_SCALAR >
462  ++__iter;
463  return *this;
464  }
465 
466  template < typename GUM_SCALAR >
468  return __iter == __set.end();
469  }
470 
471  template < typename GUM_SCALAR >
473  operator!=(const RefIterator& from) const {
474  return __iter != from.__iter;
475  }
476 
477  template < typename GUM_SCALAR >
479  operator==(const RefIterator& from) const {
480  return __iter == from.__iter;
481  }
482 
483  template < typename GUM_SCALAR >
485  operator*() const {
486  return **__iter;
487  }
488 
489  template < typename GUM_SCALAR >
491  operator->() const {
492  return *__iter;
493  }
494 
495  template < typename GUM_SCALAR >
497  const Set< PRMInstance< GUM_SCALAR >* >& set) :
498  __set(set),
499  __iter(set.begin()) {
501  }
502 
503  template < typename GUM_SCALAR >
505  const RefConstIterator& from) :
506  __set(from.__set),
507  __iter(from.__iter) {
509  }
510 
511  template < typename GUM_SCALAR >
514  }
515 
516  template < typename GUM_SCALAR >
520  __iter = from.__iter;
521  return *this;
522  }
523 
524  template < typename GUM_SCALAR >
527  ++__iter;
528  return *this;
529  }
530 
531  template < typename GUM_SCALAR >
533  return __iter == __set.end();
534  }
535 
536  template < typename GUM_SCALAR >
538  operator!=(const RefConstIterator& from) const {
539  return __iter != from.__iter;
540  }
541 
542  template < typename GUM_SCALAR >
544  operator==(const RefConstIterator& from) const {
545  return __iter == from.__iter;
546  }
547 
548  template < typename GUM_SCALAR >
549  INLINE const PRMInstance< GUM_SCALAR >&
551  return **__iter;
552  }
553 
554  template < typename GUM_SCALAR >
555  INLINE const PRMInstance< GUM_SCALAR >*
557  return *__iter;
558  }
559 
560  template < typename GUM_SCALAR >
563  return __referingAttr.begin();
564  }
565 
566  template < typename GUM_SCALAR >
567  INLINE const typename PRMInstance< GUM_SCALAR >::InvRefIterator&
569  return __referingAttr.end();
570  }
571 
572  template < typename GUM_SCALAR >
575  return __referingAttr.begin();
576  }
577 
578  template < typename GUM_SCALAR >
581  return __referingAttr.end();
582  }
583 
584  template < typename GUM_SCALAR >
585  INLINE std::vector< std::pair< PRMInstance< GUM_SCALAR >*, std::string > >&
587  return *(__referingAttr[id]);
588  }
589 
590  template < typename GUM_SCALAR >
591  INLINE const
592  std::vector< std::pair< PRMInstance< GUM_SCALAR >*, std::string > >&
594  return *(__referingAttr[id]);
595  }
596 
597  template < typename GUM_SCALAR >
599  return __referingAttr.exists(id) && (!__referingAttr[id]->empty());
600  }
601 
602  template < typename GUM_SCALAR >
605  const auto& type_attr = static_cast< const PRMAttribute< GUM_SCALAR >& >(
606  type().get(attr->safeName()));
607  attr->copyCpf(bijection(), type_attr);
608  GUM_ASSERT(attr->cpf().contains(attr->type().variable()));
609  }
610 
611  } /* namespace prm */
612 } /* namespace gum */
const PRMInstance< GUM_SCALAR > & operator*() const
PRMClass< GUM_SCALAR > * __type
The type of this PRMInstance<GUM_SCALAR>.
Definition: PRMInstance.h:510
const PRMInstance< GUM_SCALAR > & getInstance(NodeId id) const
Fast access to the first instance in a PRMReferenceSlot or PRMSlotChain<GUM_SCALAR>.
RefConstIterator(const Set< PRMInstance< GUM_SCALAR > * > &set)
Unsafe Const Iterators for hashtablesHashTableConstIterator provides a fast but unsafe way to parse H...
Definition: hashTable.h:2465
Set< PRMInstance< GUM_SCALAR > *>::const_iterator __iter
Definition: PRMInstance.h:419
virtual ~PRMInstance()
Destructor.
MultiDimImplementation< GUM_SCALAR > * buildImpl() const
Returns a pointer over an empty gum::MultiDimImplementation of the good type for this PRMAggregate...
void add(NodeId id, PRMInstance< GUM_SCALAR > &instance)
Add an PRMInstance<GUM_SCALAR> to a given PRMReferenceSlot, PRMSlotChain<GUM_SCALAR> or output node...
PRMInstance(const std::string &name, PRMClass< GUM_SCALAR > &type)
Default constructor of an PRMInstance<GUM_SCALAR>.
virtual void addParent(const PRMClassElement< GUM_SCALAR > &elt)=0
See gum::PRMClassElement::_addParent().
PRMAttribute< GUM_SCALAR > & get(NodeId id)
Getter on an PRMAttribute<GUM_SCALAR> of this PRMInstance<GUM_SCALAR>.
const std::string & name() const
Returns the name of this object.
Definition: PRMObject_inl.h:35
virtual PRMType & type()=0
See gum::PRMClassElement::type().
An PRMInstance is a Bayesian Network fragment defined by a Class and used in a PRMSystem.
Definition: PRMInstance.h:63
void instantiate()
Instantiate all nodes which requires it.
bool operator==(const RefIterator &from) const
void __addReferingInstance(PRMSlotChain< GUM_SCALAR > *sc, PRMInstance< GUM_SCALAR > *i)
Add this as a referring instance over the attribute pointed by sc in i.
Unsafe Iterators for hashtablesHashTableIterator provides a fast but unsafe way to parse HashTables...
Definition: hashTable.h:2750
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
PRMClass< GUM_SCALAR > & type()
Returns the type of this instance.
Bijection< const DiscreteVariable *, const DiscreteVariable *> __bijection
A bijection used for MultiDim handling.
Definition: PRMInstance.h:529
PRMInstance< GUM_SCALAR > * operator->() const
Abstract class representing an element of PRM class.
NodeProperty< std::vector< pair > *> __referingAttr
The set of pair (instance, attribute) referring an attribute of this instance.
Definition: PRMInstance.h:526
bool exists(NodeId id) const
Returns true if id matches an PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.
void __doInstantiate()
Starts this instance instantiations.
virtual PRMType & type()
This is similar to the following call: this->lastElt().type()
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
A PRMReferenceSlot represent a relation between two PRMClassElementContainer.
Definition: PRMObject.h:223
PRMClassElementContainer< GUM_SCALAR > & slotType()
Returns the type of this slot, which is a PRMClassElementContainer (it is not the type of PRMObject)...
bool __instantiated
True if this instance has been instantiated.
Definition: PRMInstance.h:507
Size size() const
Returns the number of attributes in 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...
Definition: PRMInstance.h:519
RefIterator(Set< PRMInstance< GUM_SCALAR > * > &set)
Nested class to iterate over PRMReferenceSlot and PRMSlotChain<GUM_SCALAR> instantiations.
Definition: PRMInstance.h:396
void __copyAttributeCPF(PRMAttribute< GUM_SCALAR > *attr)
Copy the content of an PRMAttribute<GUM_SCALAR> from its Class<GUM_SCALAR> counterpart.
void __instantiateSlotChain(PRMSlotChain< GUM_SCALAR > *sc)
Retrieve all instances referred by sc.
InvRefIterator beginInvRef()
Alias to iterate over the gum::prm::PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.
std::vector< std::pair< PRMInstance< GUM_SCALAR > *, std::string > > & getRefAttr(NodeId id)
Returns a vector of pairs of refering attributes of id.
Representation of a setA Set is a structure that contains arbitrary elements.
Definition: set.h:165
const std::string & safeName() const
Returns the safe name of this PRMClassElement, if any.
PRMInstance< GUM_SCALAR > & operator*() const
void __copyAttribute(PRMAttribute< GUM_SCALAR > *source)
Used at construction to instantiate attributes.
prm_type
Enumeration of the different types of objects handled by a PRM.
Definition: PRMObject.h:69
bool operator==(const RefConstIterator &from) const
bool isMultiple() const
Return true if this slot chain contains at least one multiple reference slot.
void __copyAggregates(PRMAggregate< GUM_SCALAR > *source)
Used at construction to instantiate aggregates.
virtual const Potential< GUM_SCALAR > & cpf() const =0
See gum::PRMClassElement::cpf().
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...
Set< PRMInstance< GUM_SCALAR > *> & __set
Definition: PRMInstance.h:367
PRMInstance< GUM_SCALAR > & operator=(const PRMClass< GUM_SCALAR > &from)
Copy operator. Don&#39;t use it.
PRMClassElementContainer< GUM_SCALAR > & end()
Returns the PRMClassElement<GUM_SCALAR>Container over which this slot chain ends. ...
Set of pairs of elements with fast search for both elements.
Definition: bijection.h:1805
virtual prm_type obj_type() const
Returns the PRM type of this object.
virtual ClassElementType elt_type() const =0
Return the type of class element this object is.
A PRMSlotChain represents a sequence of gum::prm::PRMClassElement<GUM_SCALAR> where the n-1 first gum...
Definition: PRMObject.h:221
Abstract base class for any element defined in a PRM.
Definition: PRMObject.h:56
bool operator!=(const RefConstIterator &from) const
virtual PRMType & type()
See gum::PRMClassElement::type().
Set< PRMInstance< GUM_SCALAR > *>::iterator __iter
Definition: PRMInstance.h:368
NodeId id() const
Returns the NodeId of this element in it&#39;s class DAG.
const iterator & end()
Returns a reference over the iterator at the end of the list of gum::prm::PRMAttribute<GUM_SCALAR> in...
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
A PRMClass is an object of a PRM representing a fragment of a Bayesian Network which can be instantia...
Definition: PRMClass.h:66
bool hasRefAttr(NodeId id) const
Returns true if id has at least one referring PRMAttribute<GUM_SCALAR>.
const PRMInstance< GUM_SCALAR > * operator->() const
RefConstIterator & operator=(const RefConstIterator &from)
virtual void copyCpf(const Bijection< const DiscreteVariable *, const DiscreteVariable * > &bif, const PRMAttribute< GUM_SCALAR > &source)=0
See gum::PRMClassElement::elt_type().
PRMAttribute is a member of a Class in a PRM.
Definition: PRMAttribute.h:61
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:48
RefIterator & operator=(const RefIterator &from)
PRMClassElement< GUM_SCALAR > & lastElt()
Returns the last element of the slot chain, typically this is an gum::PRMAttribute or a gum::PRMAggre...
iterator begin()
Returns an iterator at the begining of the list of gum::prm::PRMAttribute<GUM_SCALAR> in this PRMInst...
Nested class to iterate over PRMReferenceSlot and PRMSlotChain<GUM_SCALAR> instantiations.
Definition: PRMInstance.h:345
const InvRefIterator & endInvRef()
Alias to iterate over the gum::prm::PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.
<agrum/PRM/elements/scalarAttribute.h>
Size NodeId
Type for node ids.
Definition: graphElements.h:98
void insert(const Key &k)
Inserts a new element into the set.
Definition: set_tpl.h:613
bool operator!=(const RefIterator &from) const
#define GUM_ERROR(type, msg)
Definition: exceptions.h:55
NodeProperty< PRMAttribute< GUM_SCALAR > *> __nodeIdMap
The gum::prm::PRMAttribute<GUM_SCALAR> and gum::prm::PRMAggregate<GUM_SCALAR> of this PRMInstance<GUM...
Definition: PRMInstance.h:514
Sequence< PRMClassElement< GUM_SCALAR > *> & chain()
Return the sequence representing the chain of elements in this PRMSlotChain.
const Set< PRMInstance< GUM_SCALAR > *> & getInstances(NodeId id) const
Returns the Set of PRMInstance<GUM_SCALAR> referenced by id.
const Set< PRMInstance< GUM_SCALAR > *> & __set
Definition: PRMInstance.h:418