31 template <
typename GUM_SCALAR >
33 const std::string& name,
40 if (__chain->size() < 2) {
42 "chain must contain at least two ClassElement");
45 for (
Size i = 0; i < __chain->size() - 1; ++i) {
46 if (__chain->atPos(i)->elt_type()
59 this->_safeName = PRMObject::LEFT_CAST() + lastElt().type().name()
60 + PRMObject::RIGHT_CAST() + name;
61 this->lastElt().type().variable().setName(name);
66 template <
typename GUM_SCALAR >
69 const std::string& name) :
96 template <
typename GUM_SCALAR >
100 switch (__chain->back()->elt_type()) {
106 for (
auto var : old_attr->cpf().variablesSequence()) {
107 if (var != &(old_attr->type().variable())) { bij.insert(var, var); }
110 new_elt = old_attr->copy(bij);
128 new_elt->
setId(__chain->back()->id());
129 __chain->setAtPos(__chain->size() - 1, new_elt);
132 template <
typename GUM_SCALAR >
135 delete __chain->back();
139 template <
typename GUM_SCALAR >
144 __isMultiple(source.isMultiple()) {
149 template <
typename GUM_SCALAR >
153 "Illegal call to gum::SlotChain<GUM_SCALAR> copy constructor.");
156 template <
typename GUM_SCALAR >
159 return this->prm_slotchain;
162 template <
typename GUM_SCALAR >
164 return __chain->back()->
type();
167 template <
typename GUM_SCALAR >
169 return __chain->back()->
type();
172 template <
typename GUM_SCALAR >
174 return __chain->back()->
cpf();
177 template <
typename GUM_SCALAR >
181 __chain->atPos(__chain->size() - 2))
185 template <
typename GUM_SCALAR >
189 __chain->atPos(__chain->size() - 2))
193 template <
typename GUM_SCALAR >
195 return *(__chain->back());
198 template <
typename GUM_SCALAR >
201 return *(__chain->back());
204 template <
typename GUM_SCALAR >
210 template <
typename GUM_SCALAR >
216 template <
typename GUM_SCALAR >
220 template <
typename GUM_SCALAR >
224 template <
typename GUM_SCALAR >
229 template <
typename GUM_SCALAR >
aGrUM's Potential is a multi-dimensional array with tensor operators.
Headers of gum::PRMSlotChain.
const std::string & name() const
Returns the name of this object.
The generic class for storing (ordered) sequences of objects.
Abstract class representing an element of PRM class.
virtual PRMType & type()
This is similar to the following call: this->lastElt().type()
gum is the global namespace for all aGrUM entities
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)...
virtual const Potential< GUM_SCALAR > & cpf() const
This is similar to the following call: this->lastElt().cpf()
AggregateType agg_type() const
Returns the aggregate of *this.
Set of pairs of elements with fast search for both elements.
This is a decoration of the DiscreteVariable class.
A PRMSlotChain represents a sequence of gum::prm::PRMClassElement<GUM_SCALAR> where the n-1 first gum...
virtual PRMType & type()
See gum::PRMClassElement::type().
<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.
PRMSlotChain(const std::string &name, const Sequence< PRMClassElement< GUM_SCALAR > * > &chain)
Default constructor.
PRMAttribute is a member of a Class in a PRM.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
#define GUM_ERROR(type, msg)
ClassElementType
Returns true if obj_ptr is of type PRMReferenceSlot.