39 template <
typename GUM_SCALAR >
42 __implements(nullptr), __bijection(nullptr) {
46 template <
typename GUM_SCALAR >
49 bool delayInheritance) :
51 __superClass(&super), __implements(nullptr),
55 if (!delayInheritance) {
57 __inheritClass(super);
61 template <
typename GUM_SCALAR >
64 bool delayInheritance) :
66 __superClass(nullptr),
68 __bijection(nullptr) {
71 if (!delayInheritance) { __implementInterfaces(
false); }
74 template <
typename GUM_SCALAR >
78 bool delayInheritance) :
80 __superClass(&super), __implements(nullptr),
84 if (!delayInheritance) {
86 __inheritClass(super);
90 if (__implements ==
nullptr) {
93 for (
const auto elt :
set) {
98 if (!delayInheritance) { __implementInterfaces(
false); }
101 template <
typename GUM_SCALAR >
103 for (
const auto impl : *__implements) {
104 impl->__addImplementation(
this);
105 if ((!__superClass) || (!super().isSubTypeOf(*impl))
106 || delayedInheritance) {
108 for (
auto ref : impl->referenceSlots()) {
109 __dag.addNodeWithId(ref->id());
112 for (
auto attr : impl->attributes()) {
113 __dag.addNodeWithId(attr->id());
119 template <
typename GUM_SCALAR >
123 for (
const auto& elt : __nodeIdMap) {
127 if (__implements) {
delete __implements; }
129 if (__bijection) {
delete __bijection; }
132 template <
typename GUM_SCALAR >
137 if (__superClass->__implements) {
140 *(__superClass->__implements));
142 for (
auto i : *(__superClass->__implements)) {
143 __implements->insert(i);
148 if (__implements) { __implementInterfaces(
true); }
151 template <
typename GUM_SCALAR >
155 for (
const auto c_refslot : __superClass->__referenceSlots) {
159 c_refslot->slotType()),
160 c_refslot->isArray());
162 ref->
setId(c_refslot->id());
164 if (!__dag.existsNode(ref->id())) { __dag.addNodeWithId(ref->id()); }
165 __nodeIdMap.insert(ref->id(), ref);
166 __referenceSlots.insert(ref);
168 if (__superClass->__nameMap[c_refslot->name()]
169 == __superClass->__nameMap[c_refslot->safeName()]) {
170 __nameMap.insert(ref->name(), ref);
173 __nameMap.insert(ref->safeName(), ref);
178 template <
typename GUM_SCALAR >
182 for (
const auto c_param : __superClass->__parameters) {
184 c_param->name(), c_param->valueType(), c_param->value());
186 __parameters.insert(param);
188 param->
setId(c_param->id());
189 __dag.addNodeWithId(param->id());
190 __nodeIdMap.insert(param->id(), param);
191 __nameMap.insert(param->name(), param);
196 template <
typename GUM_SCALAR >
199 for (
const auto c_attr : __superClass->__attributes) {
202 auto attr = c_attr->newFactory(*
this);
204 __bijection->insert(&(c_attr->type().variable()),
205 &(attr->type().variable()));
206 attr->setId(c_attr->id());
208 __dag.addNodeWithId(attr->id());
212 __nodeIdMap.insert(attr->id(), attr);
213 __attributes.insert(attr);
215 if (__superClass->__nameMap[c_attr->name()]
216 == __superClass->__nameMap[c_attr->safeName()]) {
217 __nameMap.insert(attr->name(), attr);
220 __nameMap.insert(attr->safeName(), attr);
225 template <
typename GUM_SCALAR >
228 for (
const auto c_agg : __superClass->__aggregates) {
233 c_agg->name(), c_agg->agg_type(), c_agg->type(), c_agg->label());
236 c_agg->name(), c_agg->agg_type(), c_agg->type());
241 __bijection->insert(&(c_agg->type().variable()),
242 &(agg->
type().variable()));
243 agg->
setId(c_agg->id());
244 __dag.addNodeWithId(agg->
id());
245 __nodeIdMap.insert(agg->
id(), agg);
246 __aggregates.insert(agg);
248 if (__superClass->__nameMap[c_agg->name()]
249 == __superClass->__nameMap[c_agg->safeName()])
250 __nameMap.insert(agg->
name(), agg);
252 __nameMap.insert(agg->
safeName(), agg);
257 template <
typename GUM_SCALAR >
261 for (
const auto c_sc : __superClass->__slotChains) {
263 if (!(__nameMap.exists(c_sc->name())
264 && __nameMap.exists(c_sc->safeName()))) {
268 auto chain = c_sc->chain();
270 chain.setAtPos(0, __nameMap[c_sc->chain().front()->name()]);
273 __bijection->insert(&(c_sc->type().variable()),
274 &(sc->type().variable()));
275 sc->
setId(c_sc->id());
276 __dag.addNodeWithId(sc->id());
277 __nodeIdMap.insert(sc->id(), sc);
278 __slotChains.insert(sc);
280 if (!__nameMap.exists(sc->name())) {
281 __nameMap.insert(sc->name(), sc);
283 if (!__nameMap.exists(sc->safeName())) {
284 __nameMap.insert(sc->safeName(), sc);
291 template <
typename GUM_SCALAR >
294 auto& elt = this->
get(name);
298 "you can only complete inheritance for attributes");
301 for (
const auto& prnt : super().containerDag().parents(elt.id())) {
302 this->addArc(super().
get(prnt).safeName(), elt.safeName());
309 attr.
copyCpf(*__bijection, super_attr);
314 template <
typename GUM_SCALAR >
325 __implements->insert(i);
339 c_param->name(), c_param->valueType(), c_param->value());
341 __parameters.insert(param);
343 param->
setId(c_param->id());
344 __nodeIdMap.insert(param->id(), param);
345 __nameMap.insert(param->name(), param);
352 auto attr = c_attr->newFactory(*
this);
354 bij.
insert(&(c_attr->type().variable()), &(attr->type().variable()));
355 attr->setId(c_attr->id());
356 __nodeIdMap.insert(attr->id(), attr);
357 __attributes.insert(attr);
360 __nameMap.insert(attr->name(), attr);
363 __nameMap.insert(attr->safeName(), attr);
372 c_agg->name(), c_agg->agg_type(), c_agg->type(), c_agg->label());
375 c_agg->name(), c_agg->agg_type(), c_agg->type());
378 bij.
insert(&(c_agg->type().variable()), &(agg->
type().variable()));
379 agg->
setId(c_agg->id());
380 __nodeIdMap.insert(agg->
id(), agg);
381 __aggregates.insert(agg);
384 __nameMap.insert(agg->
name(), agg);
386 __nameMap.insert(agg->
safeName(), agg);
394 c_refslot->slotType()),
395 c_refslot->isArray());
397 ref->
setId(c_refslot->id());
398 __nodeIdMap.insert(ref->
id(), ref);
399 __referenceSlots.insert(ref);
402 __nameMap.insert(ref->
name(), ref);
404 __nameMap.insert(ref->
safeName(), ref);
414 chain.
setAtPos(0, __nameMap[c_slotchain->chain().front()->name()]);
418 bij.
insert(&(c_slotchain->type().variable()), &(sc->
type().variable()));
419 sc->
setId(c_slotchain->id());
420 __nodeIdMap.insert(sc->
id(), sc);
421 __slotChains.insert(sc);
423 __nameMap.insert(sc->
name(), sc);
424 __nameMap.insert(sc->
safeName(), sc);
429 __nodeIdMap[arc.tail()]->addChild(*(__nodeIdMap[arc.head()]));
430 __nodeIdMap[arc.head()]->addParent(*(__nodeIdMap[arc.tail()]));
434 this->_copyIOFlags(c);
438 __nameMap[attr->safeName()]);
444 template <
typename GUM_SCALAR >
448 case PRMObject::prm_type::CLASS: {
451 while (current != 0) {
452 if (current == &(cec))
return true;
460 case PRMObject::prm_type::PRM_INTERFACE: {
461 if (__implements !=
nullptr) {
465 if (__implements->exists(
469 for (
const auto impl : *__implements)
470 if (impl->isSubTypeOf(i))
return true;
482 template <
typename GUM_SCALAR >
484 const std::string& head_name) {
489 tail = __nameMap[tail_name];
490 head = __nameMap[head_name];
493 "tail and/or head of arc does not exists in this Class");
499 "a PRMReferenceSlot<GUM_SCALAR> can " 500 "not on neither side of an arc");
506 "illegal insertion of an arc between two SlotChain<GUM_SCALAR>");
509 if (!__dag.existsArc(
Arc(tail->
id(), head->
id()))) {
510 __dag.addArc(tail->
id(), head->
id());
513 "duplicate arc " << tail_name <<
"->" << head_name);
516 get(tail->
id()).addChild(
get(head->
id()));
517 get(head->
id()).addParent(
get(tail->
id()));
523 this->setInputNode(*head,
true);
524 sc->
end().setOutputNode(sc->
end().get(sc->
lastElt().safeName()),
true);
528 template <
typename GUM_SCALAR >
532 for (
auto i : implements()) {
533 if (i->exists(elt->
name())) { __checkInterface(elt, i); }
540 template <
typename GUM_SCALAR >
544 const auto& i_elt = i->
get(elt->
name());
548 if (!(is_attr || is_agg)) {
552 if (!elt->
type().isSubTypeOf(i_elt.type())) {
554 "Attribute type does not respect class interface");
557 if (elt->
type() != i_elt.type()) {
558 if (!this->exists(i_elt.safeName())) {
560 "Attribute type does not respect class interface");
562 elt = &(this->
get(i_elt.safeName()));
566 if (!__dag.existsNode(i_elt.id())) {
571 if (elt->
id() != i_elt.id()) {
573 for (
auto child : __dag.children(elt->
id())) {
574 __dag.addArc(i_elt.id(), child);
576 __dag.eraseNode(elt->
id());
578 __nodeIdMap.erase(elt->
id());
579 elt->
setId(i_elt.id());
580 __nodeIdMap.insert(elt->
id(), elt);
583 template <
typename GUM_SCALAR >
587 for (
auto i : implements()) {
588 if (i->exists(ref->
name())) { __checkRefInterface(ref, i); }
595 template <
typename GUM_SCALAR >
598 auto& i_elt = i->
get(ref->
name());
599 if (i_elt.elt_type() != ref->
elt_type()) {
603 if (!ref->
slotType().isSubTypeOf(i_ref.slotType())) {
605 "ReferenceSlot type does not respect class interface");
608 if (!__dag.exists(i_ref.id())) {
610 "class " << this->name() <<
" does not respect interface " 611 << i->
name() <<
" implementation");
614 if (ref->
id() != i_ref.id()) { __dag.eraseNode(ref->
id()); }
615 __nodeIdMap.erase(ref->
id());
616 ref->
setId(i_ref.id());
617 __nodeIdMap.insert(ref->
id(), ref);
620 template <
typename GUM_SCALAR >
622 if (__nameMap.exists(elt->
name())) {
624 "name " << elt->
name()
625 <<
" already used by another ClassElement");
629 __dag.addNodeWithId(elt->
id());
630 __nodeIdMap.insert(elt->
id(), elt);
631 __nameMap.insert(elt->
name(), elt);
634 __nameMap.insert(elt->
safeName(), elt);
649 __checkInterfaces(elt);
651 __addIOInterfaceFlags(elt);
661 __checkInterfaces(elt);
663 __addIOInterfaceFlags(elt);
669 __referenceSlots.insert(ref);
672 __checkRefInterfaces(ref);
694 template <
typename GUM_SCALAR >
700 while (parent->type().isSubType()) {
706 for (
auto i : implements()) {
718 __dag.addNodeWithId(child->
id());
720 __nodeIdMap.insert(child->
id(), child);
722 __nameMap.insert(child->
safeName(), child);
723 __attributes.insert(child);
726 __dag.addArc(parent->id(), child->
id());
732 template <
typename GUM_SCALAR >
736 if (!super().exists(overloader->
name())) {
738 "found no ClassElement<GUM_SCALAR> to overload");
742 "overload is possible only with subclasses");
746 if (overloaded == overloader) {
748 "dupplicate ClassElement " << overloader->
name());
751 if (!__checkOverloadLegality(overloaded, overloader)) {
757 auto overloader_attr =
759 auto overloaded_attr =
761 __overloadAttribute(overloader_attr, overloaded_attr);
762 __addIOInterfaceFlags(overloader);
769 __addIOInterfaceFlags(overloader);
776 auto overloader_ref =
778 auto overloaded_ref =
780 __overloadReference(overloader_ref, overloaded_ref);
786 "SlotChain<GUM_SCALAR> can not be overloaded");
791 auto overloaded_param =
793 auto overloader_param =
795 __overloadParameter(overloader_param, overloaded_param);
803 return overloader->
id();
806 template <
typename GUM_SCALAR >
810 __dag.eraseParents(overloaded->
id());
813 if (overloader->
type() != overloaded->
type()) {
815 __dag.addNodeWithId(overloader->
id());
816 __nodeIdMap.insert(overloader->
id(), overloader);
817 __nameMap[overloader->
name()] = overloader;
818 __nameMap.insert(overloader->
safeName(), overloader);
819 __attributes.insert(overloader);
820 __addCastDescendants(overloader, overloaded);
822 overloader->
setId(overloaded->
id());
823 __nodeIdMap[overloader->
id()] = overloader;
824 __nameMap[overloader->
name()] = overloader;
825 __nameMap[overloader->
safeName()] = overloader;
826 __attributes.erase(overloaded);
827 __attributes.insert(overloader);
833 template <
typename GUM_SCALAR >
838 overloader->
setId(overloaded->
id());
839 __nodeIdMap[overloader->
id()] = overloader;
840 __nameMap[overloader->
name()] = overloader;
841 __nameMap.insert(overloader->
safeName(), overloader);
842 __referenceSlots.insert(overloader);
846 std::vector< PRMSlotChain< GUM_SCALAR >* > toRemove, toAdd;
849 for (
const auto slotchain : __slotChains) {
854 if ((slotchain->chain().atPos(0) == overloaded)) {
858 auto elt = ++(slotchain->chain().begin());
860 while (elt != slotchain->chain().end()) {
862 next = &(ref->
slotType().get((*elt)->name()));
871 if (seq.
back()->type() != slotchain->lastElt().type()) {
875 .get(slotchain->lastElt().safeName())));
877 std::string dot =
".";
879 for (
Size i = 0; i < seq.
size() - 1; ++i) {
880 sc_name += seq.
atPos(i)->name() + dot;
883 sc_name += seq.
back()->safeName();
885 sc->
setId(slotchain->id());
887 for (
const auto child : this->containerDag().children(sc->
id())) {
888 auto& elt =
get(child);
891 auto& old_type = slotchain->lastElt().
type();
892 auto& new_type = sc->
lastElt().type();
893 attr.swap(old_type, new_type);
903 toRemove.push_back(slotchain);
906 slotchain->chain().setAtPos(0, overloader);
911 for (
const auto torem : toRemove) {
912 __nameMap.erase(torem->name());
913 __slotChains.erase(torem);
917 for (
const auto toadd : toAdd) {
918 __nameMap.insert(toadd->name(), toadd);
919 __nodeIdMap[toadd->id()] = toadd;
920 __slotChains.insert(sc);
924 __referenceSlots.erase(overloaded);
925 __nameMap.erase(overloaded->
safeName());
929 template <
typename GUM_SCALAR >
933 overloader->
setId(overloaded->
id());
934 __nodeIdMap[overloader->
id()] = overloader;
935 __nameMap[overloader->
name()] = overloader;
936 __nameMap[overloader->
safeName()] = overloader;
937 __parameters.erase(overloaded);
938 __parameters.insert(overloader);
942 template <
typename GUM_SCALAR >
948 while (parent->
type().superType() != end->
type()) {
951 __nodeIdMap.insert(child->
id(), child);
952 __dag.addNodeWithId(child->
id());
954 __nameMap.insert(child->
safeName(), child);
955 __attributes.insert(child);
956 __addIOInterfaceFlags(child);
959 __dag.addArc(parent->
id(), child->
id());
964 __dag.addArc(parent->
id(), end->
id());
967 template <
typename GUM_SCALAR >
970 for (
auto ext : __extensions) {
976 template <
typename GUM_SCALAR >
980 if (__implements !=
nullptr) {
981 for (
const auto impl : *__implements) {
986 if (impl->exists(elt->
name())) {
988 this->_getIOFlag(*elt).second =
true;
990 this->_setIOFlag(*elt, std::make_pair(
false,
true));
994 super = &(super->
super());
995 }
catch (
NotFound&) { super =
nullptr; }
1001 template <
typename GUM_SCALAR >
1012 template <
typename GUM_SCALAR >
1014 return PRMObject::prm_type::CLASS;
1017 template <
typename GUM_SCALAR >
1022 template <
typename GUM_SCALAR >
1027 template <
typename GUM_SCALAR >
1030 return *(__nodeIdMap[id]);
1036 template <
typename GUM_SCALAR >
1040 return *(__nodeIdMap[id]);
1043 "no ClassElement<GUM_SCALAR> with the given NodeId (" <<
id 1048 template <
typename GUM_SCALAR >
1052 return *(__nameMap[name]);
1055 "no ClassElement<GUM_SCALAR> with the given name (" << name
1060 template <
typename GUM_SCALAR >
1064 return *(__nameMap[name]);
1067 "no ClassElement<GUM_SCALAR> with the given name (" << name
1072 template <
typename GUM_SCALAR >
1075 return __attributes;
1078 template <
typename GUM_SCALAR >
1081 return __parameters;
1085 template <
typename GUM_SCALAR >
1094 prefix(s + ref.name() +
"."),
1095 c(static_cast< const
PRMClass< GUM_SCALAR >* >(&(ref.slotType()))),
1099 template <
typename GUM_SCALAR >
1104 for (
const auto p : parameters()) {
1105 params.
insert(p->name(), p);
1108 std::queue< ParamScopeData< GUM_SCALAR > > queue;
1110 for (
const auto ref : referenceSlots()) {
1111 if (PRMObject::isClass(ref->slotType())) {
1116 while (!queue.empty()) {
1117 auto data = queue.front();
1120 if (data.depth < 5) {
1121 for (
const auto p : data.c->parameters()) {
1122 params.
insert(data.prefix + p->name(), p);
1125 for (
const auto ref : data.c->referenceSlots()) {
1126 if (PRMObject::isClass(ref->slotType())) {
1133 GUM_TRACE(
"Depth limit reached when looking up parameters");
1140 template <
typename GUM_SCALAR >
1143 return __aggregates;
1146 template <
typename GUM_SCALAR >
1149 return __referenceSlots;
1152 template <
typename GUM_SCALAR >
1155 return __slotChains;
1158 template <
typename GUM_SCALAR >
1161 return *__superClass;
1167 template <
typename GUM_SCALAR >
1171 return *__implements;
1174 "this Class does not implement any Interface<GUM_SCALAR>");
1178 template <
typename GUM_SCALAR >
1184 template <
typename GUM_SCALAR >
1190 template <
typename GUM_SCALAR >
1196 template <
typename GUM_SCALAR >
1202 template <
typename GUM_SCALAR >
1206 __nameMap.insert(overloader->
safeName(), overloader);
1207 __aggregates.insert(overloader);
1210 template <
typename GUM_SCALAR >
1218 if (!overloader->
type().isSubTypeOf(overloaded->
type())) {
1225 const auto& new_slot_type =
1228 const auto& old_slot_type =
1232 if (!new_slot_type.isSubTypeOf(old_slot_type)) {
return false; }
1238 auto overloaded_param =
1240 auto overloader_param =
1254 template <
typename GUM_SCALAR >
1257 return __extensions;
1260 template <
typename GUM_SCALAR >
1262 __extensions.insert(c);
1265 template <
typename GUM_SCALAR >
1267 const std::string& safe_name)
const {
1271 return elt.
type().name() ==
get(elt.
name()).type().name();
1277 template <
typename GUM_SCALAR >
1281 if (!this->_getIOFlag(elt).second) {
1283 for (
auto i : *__implements) {
1284 if (i->isOutputNode(elt)) {
return true; }
1288 if (__superClass && (__superClass->isOutputNode(elt))) {
return true; }
void insert(const T1 &first, const T2 &second)
Inserts a new association in the gum::Bijection.
PRMParameter is a member of a Class in a PRM.
PRMClass< GUM_SCALAR > * __superClass
The alternate PRMClassElementContainer<GUM_SCALAR> searched for elements defined in this...
virtual PRMAttribute< GUM_SCALAR > * getCastDescendant() const =0
Returns a proper cast descendant of this PRMAttribute.
const std::string & name() const
Returns the name of this object.
const PRMClass< GUM_SCALAR > * c
Size size() const noexcept
Returns the size of the sequence.
virtual PRMType & type()=0
See gum::PRMClassElement::type().
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
The generic class for storing (ordered) sequences of objects.
virtual prm_type obj_type() const =0
Returns the type of this object.
Abstract class representing an element of PRM class.
Set< PRMReferenceSlot< GUM_SCALAR > *> __referenceSlots
The sequence of PRMReferenceSlot<GUM_SCALAR>.
Base class for discrete random variable.
Set< PRMAggregate< GUM_SCALAR > *> __aggregates
The sequence of aggregate.
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.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void setLabel(Idx idx)
Set the aggregator's label.
A PRMReferenceSlot represent a relation between two PRMClassElementContainer.
PRMClassElementContainer< GUM_SCALAR > & slotType()
Returns the type of this slot, which is a PRMClassElementContainer (it is not the type of PRMObject)...
The class for generic Hash Tables.
void _findAllSubtypes(Set< PRMClassElementContainer< GUM_SCALAR > * > &set)
Fills set with all the subtypes of this Class<GUM_SCALAR>.
Set< PRMSlotChain< GUM_SCALAR > *> __slotChains
The set of gum::PRMSlotChain<GUM_SCALAR>s.
virtual PRMClassElement< GUM_SCALAR >::ClassElementType elt_type() const
Implementation of the pure virtual method of PRMObject.
Set< PRMInterface< GUM_SCALAR > *> * __implements
The Set of implemented interface of this.
Representation of a setA Set is a structure that contains arbitrary elements.
const std::string & safeName() const
Returns the safe name of this PRMClassElement, if any.
std::shared_ptr< Idx > sharedLabel() const
Returns the shared_ptr holding this Aggregate label.
prm_type
Enumeration of the different types of objects handled by a PRM.
virtual void overload(PRMAttribute< GUM_SCALAR > *source)
Set this as overload of source (necessayr to preserver internal pointers for MultiDims).
The base class for all directed edgesThis class is used as a basis for manipulating all directed edge...
PRMClass(const std::string &name)
Default constructor.
ParamScopeData(const std::string &s, const PRMReferenceSlot< GUM_SCALAR > &ref, Idx d)
PRMClassElementContainer< GUM_SCALAR > & end()
Returns the PRMClassElement<GUM_SCALAR>Container over which this slot chain ends. ...
Base class for all aGrUM's exceptions.
Set of pairs of elements with fast search for both elements.
An PRMInterface is implemented by a Class<GUM_SCALAR> and defines a set of PRMReferenceSlot<GUM_SCALA...
virtual ClassElementType elt_type() const =0
Return the type of class element this object is.
virtual PRMType & type()=0
Return a reference over the gum::PRMType of this class element.
A PRMSlotChain represents a sequence of gum::prm::PRMClassElement<GUM_SCALAR> where the n-1 first gum...
PRMInterface< GUM_SCALAR > & super()
Returns the superInterface of this PRMInterface.
NodeId nextNodeId()
Returns the next value of an unique counter for PRM's node id.
virtual PRMType & type()
See gum::PRMClassElement::type().
void erase(const Key &k)
Remove an element from the sequence.
virtual PRMClassElement< GUM_SCALAR > & get(NodeId id)
See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(NodeId).
<agrum/PRM/classElementContainer.h>
NodeId id() const
Returns the NodeId of this element in it's class DAG.
virtual void setId(NodeId id)
Used to assign the id of this element.
A PRMClass is an object of a PRM representing a fragment of a Bayesian Network which can be instantia...
virtual void setAsCastDescendant(PRMAttribute< GUM_SCALAR > *attr)=0
Define attr as a cast descendant of this PRMAttribute.
void __addExtension(PRMClass< GUM_SCALAR > *c)
This method is called when a sub-Class<GUM_SCALAR> of this Class<GUM_SCALAR> is created.
Size Idx
Type for indexes.
ParameterType valueType() const
See gum::PRMClassElement::elt_type().
virtual void copyCpf(const Bijection< const DiscreteVariable *, const DiscreteVariable * > &bif, const PRMAttribute< GUM_SCALAR > &source)=0
See gum::PRMClassElement::elt_type().
Set< PRMAttribute< GUM_SCALAR > *> __attributes
The sequence of PRMAttribute<GUM_SCALAR>s.
PRMAttribute is a member of a Class in a PRM.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
PRMClassElement< GUM_SCALAR > & lastElt()
Returns the last element of the slot chain, typically this is an gum::PRMAttribute or a gum::PRMAggre...
value_type & insert(const Key &key, const Val &val)
Adds a new element (actually a copy of this element) into the hash table.
HashTable< std::string, PRMClassElement< GUM_SCALAR > *> __nameMap
Mapping between a member's name and itself. Used for fast access to a member given it's name...
virtual const DAG & containerDag() const
Returns the gum::DAG of this PRMClassElementContainer.
void setAtPos(Idx i, const Key &newKey)
Change the value.
Size NodeId
Type for node ids.
void insert(const Key &k)
Inserts a new element into the set.
const Key & back() const
Returns the last element of the sequence.
#define GUM_ERROR(type, msg)
const Key & atPos(Idx i) const
Returns the object at the pos i.
Set< PRMParameter< GUM_SCALAR > *> __parameters
The Set of parameters in this Class<GUM_SCALAR>.
void insert(const Key &k)
Insert an element at the end of the sequence.