aGrUM  0.16.0
PRMScalarAttribute.h
Go to the documentation of this file.
1 
30 #ifndef GUM_SCALAR_ATTRIBUTE_H
31 #define GUM_SCALAR_ATTRIBUTE_H
32 
33 #include <agrum/agrum.h>
34 #include <agrum/core/bijection.h>
37 
38 
39 namespace gum {
40  namespace prm {
41 
66  template < typename GUM_SCALAR >
67  class PRMScalarAttribute : public PRMAttribute< GUM_SCALAR > {
68  public:
69  // ========================================================================
71  // ========================================================================
73 
86  PRMScalarAttribute(const std::string& name,
87  const PRMType& type,
90 
92  virtual ~PRMScalarAttribute();
93 
95  // ========================================================================
97  // ========================================================================
99 
101  newFactory(const PRMClass< GUM_SCALAR >& c) const;
104 
105  virtual void copyCpf(
107  const PRMAttribute< GUM_SCALAR >& source);
108 
111  elt_type() const;
112 
114  virtual PRMType& type();
115 
117  virtual const PRMType& type() const;
118 
120  virtual const Potential< GUM_SCALAR >& cpf() const;
121 
123  virtual void addParent(const PRMClassElement< GUM_SCALAR >& elt);
124 
126  virtual void addChild(const PRMClassElement< GUM_SCALAR >& elt);
127 
130  virtual void becomeCastDescendant(PRMType& subtype);
131 
133  virtual void swap(const PRMType& old_type, const PRMType& new_type);
134 
136  protected:
138  PRMScalarAttribute(const PRMScalarAttribute& source);
139 
142 
143  virtual PRMType* _type();
144  virtual void _type(PRMType* t);
145 
146  private:
147  // ========================================================================
149  // ========================================================================
151 
154 
157 
159  };
160 
161 
162 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
163  extern template class PRMScalarAttribute< double >;
164 #endif
165 
166 
167  } /* namespace prm */
168 } // namespace gum
169 
171 
172 #endif /* GUM_SCALAR_ATTRIBUTE_H */
virtual void addChild(const PRMClassElement< GUM_SCALAR > &elt)
See gum::PRMClassElement::_addChild().
aGrUM&#39;s Potential is a multi-dimensional array with tensor operators.
Definition: potential.h:60
virtual void becomeCastDescendant(PRMType &subtype)
See gum::PRMClassElement::elt_type().
virtual ~PRMScalarAttribute()
Destructor.
virtual void swap(const PRMType &old_type, const PRMType &new_type)
Swap old_type with new_type in the PRMClassElement cpt.
const std::string & name() const
Returns the name of this object.
Definition: PRMObject_inl.h:35
Abstract class representing an element of PRM class.
virtual PRMType & type()
See gum::PRMClassElement::type().
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
virtual PRMAttribute< GUM_SCALAR > * newFactory(const PRMClass< GUM_SCALAR > &c) const
See gum::PRMClassElement::elt_type().
virtual PRMClassElement< GUM_SCALAR >::ClassElementType elt_type() const
See gum::PRMClassElement::elt_type().
virtual void copyCpf(const Bijection< const DiscreteVariable *, const DiscreteVariable * > &bif, const PRMAttribute< GUM_SCALAR > &source)
See gum::PRMClassElement::elt_type().
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual const Potential< GUM_SCALAR > & cpf() const
See gum::PRMClassElement::cpf().
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
PRMType * __type
The random variable type of this attribute.
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::PRMClassElement::elt_type().
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
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 setAsCastDescendant(PRMAttribute< GUM_SCALAR > *attr)
See gum::PRMClassElement::elt_type().
Potential< GUM_SCALAR > * __cpf
A pointer on the Potential of this attribute.
virtual PRMAttribute< GUM_SCALAR > * getCastDescendant() const
See gum::PRMClassElement::elt_type().
<agrum/multidim/multiDimImplementation.h>
PRMAttribute is a member of a Class in a PRM.
Definition: PRMAttribute.h:61
virtual void addParent(const PRMClassElement< GUM_SCALAR > &elt)
See gum::PRMClassElement::_addParent().
<agrum/PRM/elements/scalarAttribute.h>
PRMScalarAttribute(const std::string &name, const PRMType &type, MultiDimImplementation< GUM_SCALAR > *impl=new MultiDimArray< GUM_SCALAR >())
Constructor used by gum::Class.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
PRMScalarAttribute & operator=(const PRMScalarAttribute &from)
Copy operator. Don&#39;t use it.
ClassElementType
Returns true if obj_ptr is of type PRMReferenceSlot.