aGrUM  0.18.1
a C++ library for (probabilistic) graphical models
PRMInstance_tpl.h
Go to the documentation of this file.
1 
30 
32 
33 namespace gum {
34  namespace prm {
35  template < typename GUM_SCALAR >
36  PRMInstance< GUM_SCALAR >::PRMInstance(const std::string& name,
37  PRMClass< GUM_SCALAR >& type) :
38  PRMObject(name),
39  instantiated__(false), type__(&type) {
40  GUM_CONSTRUCTOR(PRMInstance);
41 
42  // First we create attributes for each aggregate in type
43  for (const auto agg: type__->aggregates())
44  copyAggregates__(agg);
45 
46  // We add attributes in type by reference for inner ones and by copy for
47  // output ones
48  for (const auto attr: type__->attributes())
49  copyAttribute__(attr);
50  }
51 
52  template < typename GUM_SCALAR >
54  GUM_DESTRUCTOR(PRMInstance);
55 
56  for (const auto& elt: nodeIdMap__)
57  delete elt.second;
58 
59  for (const auto& elt: referenceMap__)
60  delete elt.second;
61 
62  for (const auto& elt: referingAttr__)
63  delete elt.second;
64  }
65 
66  template < typename GUM_SCALAR >
68  if (!instantiated__) {
69  instantiated__ = true;
71  }
72  }
73 
74  template < typename GUM_SCALAR >
76  // First retrieving any referenced instance
77  for (const auto chain: type().slotChains()) {
79  }
80 
81  // Now we need to add referred instance to each input node
82  // For Attributes we first add parents, then we initialize CPF
83  for (const auto attr: type().attributes()) {
84  copyAttributeCPF__(nodeIdMap__[(*attr).id()]);
85  }
86 
87  // For PRMAggregate<GUM_SCALAR> we add parents
88  for (const auto agg: type().aggregates()) {
89  PRMAttribute< GUM_SCALAR >& attr = get(agg->safeName());
90 
91  for (const auto node: type().containerDag().parents(agg->id())) {
92  try {
93  attr.addParent(get(node));
94  } catch (NotFound&) {
95  auto elt = &(type().get(node));
96  auto sc = static_cast< PRMSlotChain< GUM_SCALAR >* >(elt);
97 
98  try {
99  const auto& instances = getInstances(sc->id());
100 
101  for (const auto inst: instances) {
102  attr.addParent(inst->get(sc->lastElt().safeName()));
103  }
104  } catch (NotFound&) { // there is no parents for this agg
105  }
106  }
107  }
108  }
109  }
110 
111  template < typename GUM_SCALAR >
114  auto first_id = sc->chain()[0]->id();
115  if (!referenceMap__.exists(first_id)) { return; }
116  auto set =
117  new Set< PRMInstance< GUM_SCALAR >* >(*(referenceMap__[first_id]));
118  // We proceed with a width-first run of the slot chain
119  for (Size idx = 1; idx < sc->chain().size() - 1; ++idx) {
120  auto temp = new Set< PRMInstance< GUM_SCALAR >* >();
121  for (auto current: *set) {
122  auto& ref = current->type().get(sc->chain()[idx]->name());
123  for (auto next: *(current->referenceMap__[ref.id()])) {
124  temp->insert(next);
125  }
126  }
127  delete set;
128  set = temp;
129  }
130 
131  GUM_ASSERT(set->size() > 0);
132  // set contains all the instances references by sc
133  if (referenceMap__.exists(sc->id())) {
134  delete referenceMap__[sc->id()];
135  referenceMap__[sc->id()] = set;
136  } else {
137  referenceMap__.insert(sc->id(), set);
138  }
139 
140  // Add refering instances
141  for (auto i: *set) {
142  addReferingInstance__(sc, i);
143  }
144 
145  // If sc is not multiple so it can be added as a parent of an attribute
146  if (!sc->isMultiple()) {
147  // We should have only one instance
148  // Less ugly way to get the single instance in set
149  for (auto instance: *set) {
150  auto& attr = instance->get(sc->lastElt().safeName());
151  bijection__.insert(&(sc->type().variable()), &(attr.type().variable()));
152  }
153  }
154  }
155 
156  template < typename GUM_SCALAR >
158  PRMInstance< GUM_SCALAR >& instance) {
160 
161  try {
162  elt = &(type().get(id));
163  } catch (NotFound&) {
164  GUM_ERROR(NotFound, "no ClassElement<GUM_SCALAR> matches the given id");
165  }
166 
167  switch (elt->elt_type()) {
170  static_cast< PRMReferenceSlot< GUM_SCALAR >* >(elt);
171 
172  // Checking if instance's type is legal
173  if (!instance.type().isSubTypeOf(ref->slotType())) {
175  "given Instance type is not a proper "
176  "subclass of the ReferenceSlot<GUM_SCALAR> slot type");
177  }
178 
179  // Checking the reference's size limit
180  if (referenceMap__.exists(id)
181  && (!static_cast< PRMReferenceSlot< GUM_SCALAR >& >(type().get(id))
182  .isArray())
183  && (referenceMap__[id]->size() == 1)) {
185  "ReferenceSlot<GUM_SCALAR> size limit reached");
186  }
187 
188  break;
189  }
190 
193  static_cast< PRMSlotChain< GUM_SCALAR >& >(type().get(id));
194 
195  // Checking if instance's type is legal
196  if (!instance.type().isSubTypeOf(sc.end())) {
198  "given Instance type is not a proper "
199  "subclass of the ClassElementContainer pointed"
200  " by the SlotChain<GUM_SCALAR>");
201  }
202 
203  // Checking the reference's size limit
204  if (referenceMap__.exists(id)
205  && (!static_cast< PRMSlotChain< GUM_SCALAR >& >(type().get(id))
206  .isMultiple())
207  && (referenceMap__[id]->size() == 1)) {
208  GUM_ERROR(OutOfUpperBound, "SlotChain<GUM_SCALAR> size limit reached");
209  }
210 
211  break;
212  }
213 
214  default: {
215  if (!type().isOutputNode(*elt)) {
217  "given ClassElement<GUM_SCALAR> is not an output node");
218  }
219  }
220  }
221 
222  if (!referenceMap__.exists(id)) {
223  referenceMap__.insert(id, new Set< PRMInstance< GUM_SCALAR >* >());
224  }
225 
226  referenceMap__[id]->insert(&instance);
227  }
228 
229  template < typename GUM_SCALAR >
231  return nodeIdMap__.size();
232  }
233 
234  template < typename GUM_SCALAR >
236  PRMAggregate< GUM_SCALAR >* source) {
237  auto attr = new PRMScalarAttribute< GUM_SCALAR >(
238  source->name(), source->type(), source->buildImpl());
239  GUM_ASSERT(&(attr->type().variable()) != &(source->type().variable()));
240  attr->setId(source->id());
241  nodeIdMap__.insert(attr->id(), attr);
242  bijection__.insert(&(source->type().variable()), &(attr->type().variable()));
243  }
244 
245  template < typename GUM_SCALAR >
247  PRMAttribute< GUM_SCALAR >* source) {
248  auto attr =
249  new PRMScalarAttribute< GUM_SCALAR >(source->name(), source->type());
250  GUM_ASSERT(&(attr->type().variable()) != &(source->type().variable()));
251  // The potential is copied when instantiate() is called
252  attr->cpf().fill((GUM_SCALAR)0);
253  attr->setId(source->id());
254  bijection__.insert(&(source->type().variable()), &(attr->type().variable()));
255  nodeIdMap__.insert(attr->id(), attr);
256  }
257 
258  template < typename GUM_SCALAR >
260  const PRMInstance< GUM_SCALAR >& source) :
261  PRMObject(source),
262  type__(source.type__) {
263  GUM_CONS_CPY(PRMInstance);
264  GUM_ERROR(FatalError, "do not copy Instance");
265  }
266 
267  template < typename GUM_SCALAR >
270  GUM_ERROR(FatalError, "do not copy Instance");
271  }
272 
273  template < typename GUM_SCALAR >
276  }
277 
278  template < typename GUM_SCALAR >
280  return *type__;
281  }
282 
283  template < typename GUM_SCALAR >
285  return *type__;
286  }
287 
288  template < typename GUM_SCALAR >
290  return nodeIdMap__.exists(id);
291  }
292 
293  template < typename GUM_SCALAR >
294  INLINE bool PRMInstance< GUM_SCALAR >::exists(const std::string& name) const {
295  return type__->exists(name) && exists(type__->get(name).id());
296  }
297 
298  template < typename GUM_SCALAR >
300  try {
301  return *(nodeIdMap__[id]);
302  } catch (NotFound&) {
303  GUM_ERROR(NotFound, "no PRMAttribute<GUM_SCALAR> with the given NodeId");
304  }
305  }
306 
307  template < typename GUM_SCALAR >
308  INLINE const PRMAttribute< GUM_SCALAR >&
310  try {
311  return *(nodeIdMap__[id]);
312  } catch (NotFound&) {
313  GUM_ERROR(NotFound, "no PRMAttribute<GUM_SCALAR> with the given NodeId");
314  }
315  }
316 
317  template < typename GUM_SCALAR >
319  PRMInstance< GUM_SCALAR >::get(const std::string& name) {
320  try {
321  return *(nodeIdMap__[type().get(name).id()]);
322  } catch (NotFound&) {
323  GUM_ERROR(NotFound, "no PRMAttribute<GUM_SCALAR> with the given name");
324  }
325  }
326 
327  template < typename GUM_SCALAR >
328  INLINE const PRMAttribute< GUM_SCALAR >&
329  PRMInstance< GUM_SCALAR >::get(const std::string& name) const {
330  try {
331  return *(nodeIdMap__[type().get(name).id()]);
332  } catch (NotFound&) {
333  GUM_ERROR(NotFound, "no PRMAttribute<GUM_SCALAR> with the given name");
334  }
335  }
336 
337  template < typename GUM_SCALAR >
340  NodeId id = i->get(sc->lastElt().safeName()).id();
341  std::string name = sc->lastElt().safeName();
342 
343  try {
344  i->referenceMap__[id]->insert(this);
345  i->referingAttr__[id]->push_back(
346  std::make_pair(this, sc->lastElt().safeName()));
347  } catch (NotFound&) {
348  i->referenceMap__.insert(id, new Set< PRMInstance< GUM_SCALAR >* >());
349  i->referenceMap__[id]->insert(this);
350  i->referingAttr__.insert(id, new std::vector< pair >());
351  i->referingAttr__[id]->push_back(
352  std::make_pair(this, sc->lastElt().safeName()));
353  }
354  }
355 
356  template < typename GUM_SCALAR >
359  return bijection__;
360  }
361 
362  template < typename GUM_SCALAR >
363  INLINE const PRMInstance< GUM_SCALAR >&
365  try {
366  if (referenceMap__[id]->size() > 0) {
367  return **(referenceMap__[id]->begin());
368  } else {
370  "no Instance associated with the given NodeId");
371  }
372  } catch (NotFound&) {
374  "no ReferenceSlot<GUM_SCALAR> or SlotChain<GUM_SCALAR> "
375  "matches the given NodeId");
376  }
377  }
378 
379  template < typename GUM_SCALAR >
380  INLINE const Set< PRMInstance< GUM_SCALAR >* >&
382  try {
383  return *(referenceMap__[id]);
384  } catch (NotFound&) {
386  "no ReferenceSlot<GUM_SCALAR> or SlotChain<GUM_SCALAR> "
387  "matches the given NodeId");
388  }
389  }
390 
391  template < typename GUM_SCALAR >
394  return nodeIdMap__.begin();
395  }
396 
397  template < typename GUM_SCALAR >
398  INLINE const typename PRMInstance< GUM_SCALAR >::iterator&
400  return nodeIdMap__.end();
401  }
402 
403  template < typename GUM_SCALAR >
406  return nodeIdMap__.begin();
407  }
408 
409  template < typename GUM_SCALAR >
410  INLINE const typename PRMInstance< GUM_SCALAR >::const_iterator&
412  return nodeIdMap__.end();
413  }
414 
415  template < typename GUM_SCALAR >
418  try {
420  } catch (NotFound&) {
421  GUM_ERROR(NotFound, "no referred instances from this NodeId");
422  }
423  }
424 
425  template < typename GUM_SCALAR >
428  try {
430  } catch (NotFound&) {
431  GUM_ERROR(NotFound, "no referred instances from this NodeId");
432  }
433  }
434 
435  template < typename GUM_SCALAR >
437  Set< PRMInstance< GUM_SCALAR >* >& set) :
438  set__(set),
439  iter__(set.begin()) {
441  }
442 
443  template < typename GUM_SCALAR >
445  const RefIterator& from) :
446  set__(const_cast< Set< PRMInstance< GUM_SCALAR >* >& >(from.set__)),
447  iter__(from.iter__) {
449  }
450 
451  template < typename GUM_SCALAR >
454  }
455 
456  template < typename GUM_SCALAR >
459  iter__ = from.iter__;
460  return *this;
461  }
462 
463  template < typename GUM_SCALAR >
466  ++iter__;
467  return *this;
468  }
469 
470  template < typename GUM_SCALAR >
472  return iter__ == set__.end();
473  }
474 
475  template < typename GUM_SCALAR >
477  const RefIterator& from) const {
478  return iter__ != from.iter__;
479  }
480 
481  template < typename GUM_SCALAR >
483  const RefIterator& from) const {
484  return iter__ == from.iter__;
485  }
486 
487  template < typename GUM_SCALAR >
490  return **iter__;
491  }
492 
493  template < typename GUM_SCALAR >
496  return *iter__;
497  }
498 
499  template < typename GUM_SCALAR >
501  const Set< PRMInstance< GUM_SCALAR >* >& set) :
502  set__(set),
503  iter__(set.begin()) {
505  }
506 
507  template < typename GUM_SCALAR >
509  const RefConstIterator& from) :
510  set__(from.set__),
511  iter__(from.iter__) {
513  }
514 
515  template < typename GUM_SCALAR >
518  }
519 
520  template < typename GUM_SCALAR >
523  const RefConstIterator& from) {
524  iter__ = from.iter__;
525  return *this;
526  }
527 
528  template < typename GUM_SCALAR >
531  ++iter__;
532  return *this;
533  }
534 
535  template < typename GUM_SCALAR >
537  return iter__ == set__.end();
538  }
539 
540  template < typename GUM_SCALAR >
542  const RefConstIterator& from) const {
543  return iter__ != from.iter__;
544  }
545 
546  template < typename GUM_SCALAR >
548  const RefConstIterator& from) const {
549  return iter__ == from.iter__;
550  }
551 
552  template < typename GUM_SCALAR >
553  INLINE const PRMInstance< GUM_SCALAR >&
555  return **iter__;
556  }
557 
558  template < typename GUM_SCALAR >
559  INLINE const PRMInstance< GUM_SCALAR >*
561  return *iter__;
562  }
563 
564  template < typename GUM_SCALAR >
567  return referingAttr__.begin();
568  }
569 
570  template < typename GUM_SCALAR >
571  INLINE const typename PRMInstance< GUM_SCALAR >::InvRefIterator&
573  return referingAttr__.end();
574  }
575 
576  template < typename GUM_SCALAR >
579  return referingAttr__.begin();
580  }
581 
582  template < typename GUM_SCALAR >
585  return referingAttr__.end();
586  }
587 
588  template < typename GUM_SCALAR >
589  INLINE std::vector< std::pair< PRMInstance< GUM_SCALAR >*, std::string > >&
591  return *(referingAttr__[id]);
592  }
593 
594  template < typename GUM_SCALAR >
595  INLINE const
596  std::vector< std::pair< PRMInstance< GUM_SCALAR >*, std::string > >&
598  return *(referingAttr__[id]);
599  }
600 
601  template < typename GUM_SCALAR >
603  return referingAttr__.exists(id) && (!referingAttr__[id]->empty());
604  }
605 
606  template < typename GUM_SCALAR >
609  const auto& type_attr = static_cast< const PRMAttribute< GUM_SCALAR >& >(
610  type().get(attr->safeName()));
611  attr->copyCpf(bijection(), type_attr);
612  GUM_ASSERT(attr->cpf().contains(attr->type().variable()));
613  }
614 
615  } /* namespace prm */
616 } /* namespace gum */
const PRMInstance< GUM_SCALAR > & operator*() const
void copyAggregates__(PRMAggregate< GUM_SCALAR > *source)
Used at construction to instantiate aggregates.
NodeProperty< std::vector< pair > *> referingAttr__
The set of pair (instance, attribute) referring an attribute of this instance.
Definition: PRMInstance.h:526
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
void doInstantiate__()
Starts this instance instantiations.
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
Unsafe Iterators for hashtablesHashTableIterator provides a fast but unsafe way to parse HashTables...
Definition: hashTable.h:2750
void instantiateSlotChain__(PRMSlotChain< GUM_SCALAR > *sc)
Retrieve all instances referred by sc.
Copyright 2005-2020 Pierre-Henri WUILLEMIN() & Christophe GONZALES() info_at_agrum_dot_org.
PRMClass< GUM_SCALAR > & type()
Returns the type of this instance.
PRMInstance< GUM_SCALAR > * operator->() const
Abstract class representing an element of PRM class.
bool exists(NodeId id) const
Returns true if id matches an PRMAttribute<GUM_SCALAR> in this PRMInstance<GUM_SCALAR>.
virtual PRMType & type()
This is similar to the following call: this->lastElt().type()
Copyright 2005-2020 Pierre-Henri WUILLEMIN() & Christophe GONZALES() info_at_agrum_dot_org.
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)...
Size size() const
Returns the number of attributes in this PRMInstance<GUM_SCALAR>.
RefIterator(Set< PRMInstance< GUM_SCALAR > * > &set)
Nested class to iterate over PRMReferenceSlot and PRMSlotChain<GUM_SCALAR> instantiations.
Definition: PRMInstance.h:396
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
Set< PRMInstance< GUM_SCALAR > *> & set__
Definition: PRMInstance.h:367
prm_type
Enumeration of the different types of objects handled by a PRM.
Definition: PRMObject.h:69
void copyAttributeCPF__(PRMAttribute< GUM_SCALAR > *attr)
Copy the content of an PRMAttribute<GUM_SCALAR> from its Class<GUM_SCALAR> counterpart.
bool operator==(const RefConstIterator &from) const
bool isMultiple() const
Return true if this slot chain contains at least one multiple reference slot.
const Set< PRMInstance< GUM_SCALAR > *> & set__
Definition: PRMInstance.h:418
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...
PRMInstance< GUM_SCALAR > & operator=(const PRMClass< GUM_SCALAR > &from)
Copy operator. Don&#39;t use it.
bool instantiated__
True if this instance has been instantiated.
Definition: PRMInstance.h:507
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.
Set< PRMInstance< GUM_SCALAR > *>::iterator iter__
Definition: PRMInstance.h:368
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().
Bijection< const DiscreteVariable *, const DiscreteVariable *> bijection__
A bijection used for MultiDim handling.
Definition: PRMInstance.h:529
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-2020 Pierre-Henri WUILLEMIN() & Christophe GONZALES() info_at_agrum_dot_org.
A PRMClass is an object of a PRM representing a fragment of a Bayesian Network which can be instantia...
Definition: PRMClass.h:66
Set< PRMInstance< GUM_SCALAR > *>::const_iterator iter__
Definition: PRMInstance.h:419
PRMClass< GUM_SCALAR > * type__
The type of this PRMInstance<GUM_SCALAR>.
Definition: PRMInstance.h:510
void addReferingInstance__(PRMSlotChain< GUM_SCALAR > *sc, PRMInstance< GUM_SCALAR > *i)
Add this as a referring instance over the attribute pointed by sc in i.
bool hasRefAttr(NodeId id) const
Returns true if id has at least one referring PRMAttribute<GUM_SCALAR>.
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
const PRMInstance< GUM_SCALAR > * operator->() const
void copyAttribute__(PRMAttribute< GUM_SCALAR > *source)
Used at construction to instantiate attributes.
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>
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
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
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.