34 template <
typename GUM_SCALAR >
36 const std::string& name,
43 if (__chain->size() < 2) {
45 "chain must contain at least two ClassElement");
48 for (
Size i = 0; i < __chain->size() - 1; ++i) {
49 if (__chain->atPos(i)->elt_type()
62 this->_safeName = PRMObject::LEFT_CAST() + lastElt().type().name()
63 + PRMObject::RIGHT_CAST() + name;
64 this->lastElt().type().variable().setName(name);
69 template <
typename GUM_SCALAR >
72 const std::string& name) :
99 template <
typename GUM_SCALAR >
103 switch (__chain->back()->elt_type()) {
109 for (
auto var : old_attr->cpf().variablesSequence()) {
110 if (var != &(old_attr->type().variable())) { bij.insert(var, var); }
113 new_elt = old_attr->copy(bij);
131 new_elt->
setId(__chain->back()->id());
132 __chain->setAtPos(__chain->size() - 1, new_elt);
135 template <
typename GUM_SCALAR >
138 delete __chain->back();
142 template <
typename GUM_SCALAR >
147 __isMultiple(source.isMultiple()) {
152 template <
typename GUM_SCALAR >
156 "Illegal call to gum::SlotChain<GUM_SCALAR> copy constructor.");
159 template <
typename GUM_SCALAR >
162 return this->prm_slotchain;
165 template <
typename GUM_SCALAR >
167 return __chain->back()->
type();
170 template <
typename GUM_SCALAR >
172 return __chain->back()->
type();
175 template <
typename GUM_SCALAR >
177 return __chain->back()->
cpf();
180 template <
typename GUM_SCALAR >
184 __chain->atPos(__chain->size() - 2))
188 template <
typename GUM_SCALAR >
192 __chain->atPos(__chain->size() - 2))
196 template <
typename GUM_SCALAR >
198 return *(__chain->back());
201 template <
typename GUM_SCALAR >
204 return *(__chain->back());
207 template <
typename GUM_SCALAR >
213 template <
typename GUM_SCALAR >
219 template <
typename GUM_SCALAR >
223 template <
typename GUM_SCALAR >
227 template <
typename GUM_SCALAR >
232 template <
typename GUM_SCALAR >
aGrUM's Potential is a multi-dimensional array with tensor operators.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
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()
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
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.