aGrUM  0.16.0
PRMFormAttribute.h
Go to the documentation of this file.
1 
30 #ifndef GUM_FORM_ATTRIBUTE_H
31 #define GUM_FORM_ATTRIBUTE_H
32 
34 
36 
37 namespace gum {
38  namespace prm {
39 
49  template < typename GUM_SCALAR >
50  class PRMFormAttribute : public PRMAttribute< GUM_SCALAR > {
51  public:
53  const std::string& name,
54  const PRMType& type,
57 
58  virtual ~PRMFormAttribute();
59 
62  newFactory(const PRMClass< GUM_SCALAR >& c) const;
63 
67 
69  virtual void copyCpf(
71  const PRMAttribute< GUM_SCALAR >& source);
72 
75  elt_type() const;
76 
78  virtual PRMType& type();
79 
81  virtual const PRMType& type() const;
82 
84  virtual const Potential< GUM_SCALAR >& cpf() const;
85 
87  virtual void addParent(const PRMClassElement< GUM_SCALAR >& elt);
88 
90  virtual void addChild(const PRMClassElement< GUM_SCALAR >& elt);
91 
94 
97  virtual void becomeCastDescendant(PRMType& subtype);
98 
100  virtual const MultiDimImplementation< std::string >& formulas() const;
101 
103  virtual void swap(const PRMType& old_type, const PRMType& new_type);
104 
105  protected:
106  virtual PRMType* _type();
107  virtual void _type(PRMType* t);
108 
109  private:
110  PRMFormAttribute(const PRMFormAttribute& source);
112 
115 
118 
121 
124 
125  void __fillCpf() const;
126  };
127 
128 
129 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
130  extern template class PRMFormAttribute< double >;
131 #endif
132 
133 
134  } /* namespace prm */
135 } // namespace gum
136 
138 
139 #endif /* GUM_ATTRIBUTE_H */
virtual void addParent(const PRMClassElement< GUM_SCALAR > &elt)
See gum::prm::PRMAttribute.
Potential< GUM_SCALAR > * __cpf
A pointer on the Potential of this attribute.
aGrUM&#39;s Potential is a multi-dimensional array with tensor operators.
Definition: potential.h:60
MultiDimImplementation< std::string > * __formulas
A pointer on the Potential of this attribute.
virtual void setAsCastDescendant(PRMAttribute< GUM_SCALAR > *attr)
See gum::prm::PRMAttribute.
const std::string & name() const
Returns the name of this object.
Definition: PRMObject_inl.h:35
virtual void swap(const PRMType &old_type, const PRMType &new_type)
Swap old_type with new_type in the PRMClassElement cpt.
virtual PRMAttribute< GUM_SCALAR > * newFactory(const PRMClass< GUM_SCALAR > &c) const
See gum::prm::PRMAttribute.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Abstract class representing an element of PRM class.
virtual PRMClassElement< GUM_SCALAR >::ClassElementType elt_type() const
See gum::prm::PRMAttribute.
virtual MultiDimImplementation< std::string > & formulas()
virtual void copyCpf(const Bijection< const DiscreteVariable *, const DiscreteVariable * > &bif, const PRMAttribute< GUM_SCALAR > &source)
See gum::prm::PRMAttribute.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
PRMFormAttribute & operator=(const PRMFormAttribute &source)
virtual PRMAttribute< GUM_SCALAR > * getCastDescendant() const
See gum::prm::PRMAttribute.
virtual const Potential< GUM_SCALAR > & cpf() const
See gum::prm::PRMAttribute.
PRMFormAttribute(const PRMClass< GUM_SCALAR > &c, const std::string &name, const PRMType &type, MultiDimImplementation< std::string > *impl=new MultiDimArray< std::string >())
virtual void addChild(const PRMClassElement< GUM_SCALAR > &elt)
See gum::prm::PRMAttribute.
Multidimensional matrix stored as an array in memory.
Definition: multiDimArray.h:54
Set of pairs of elements with fast search for both elements.
Definition: bijection.h:1805
This is a decoration of the DiscreteVariable class.
Definition: PRMType.h:63
virtual PRMAttribute< GUM_SCALAR > * copy(Bijection< const DiscreteVariable *, const DiscreteVariable * > bij) const
See gum::prm::PRMAttribute.
PRMType * __type
The random variable type of this attribute.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
const PRMClass< GUM_SCALAR > * __class
A pointe toward the class of this attribute.
A PRMClass is an object of a PRM representing a fragment of a Bayesian Network which can be instantia...
Definition: PRMClass.h:66
virtual void becomeCastDescendant(PRMType &subtype)
Change this attribute to be a cast descendant of a an attribute with type subtype.
PRMAttribute is a member of a Class in a PRM.
Definition: PRMAttribute.h:61
<agrum/PRM/elements/formAttribute.h>
virtual PRMType & type()
See gum::prm::PRMAttribute.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
ClassElementType
Returns true if obj_ptr is of type PRMReferenceSlot.