aGrUM  0.16.0
PRMAttribute.h
Go to the documentation of this file.
1 
30 #ifndef GUM_ATTRIBUTE_H
31 #define GUM_ATTRIBUTE_H
32 
35 
36 namespace gum {
37  namespace prm {
38 
60  template < typename GUM_SCALAR >
61  class PRMAttribute : public PRMClassElement< GUM_SCALAR > {
62  public:
63  // ========================================================================
65  // ========================================================================
67  explicit PRMAttribute(const std::string& name);
68 
70  virtual ~PRMAttribute();
71 
73  // ========================================================================
75  // ========================================================================
77 
79  newFactory(const PRMClass< GUM_SCALAR >& c) const = 0;
82  const = 0;
83 
84  virtual void copyCpf(
86  const PRMAttribute< GUM_SCALAR >& source) = 0;
87 
90  elt_type() const = 0;
91 
93  virtual PRMType& type() = 0;
94 
96  virtual const PRMType& type() const = 0;
97 
99  virtual const Potential< GUM_SCALAR >& cpf() const = 0;
100 
102  virtual void addParent(const PRMClassElement< GUM_SCALAR >& elt) = 0;
103 
105  virtual void addChild(const PRMClassElement< GUM_SCALAR >& elt) = 0;
106 
123  virtual PRMAttribute< GUM_SCALAR >* getCastDescendant() const = 0;
124 
157  virtual void setAsCastDescendant(PRMAttribute< GUM_SCALAR >* attr) = 0;
158 
164  virtual void becomeCastDescendant(PRMType& subtype) = 0;
165 
167  virtual void swap(const PRMType& old_type, const PRMType& new_type) = 0;
168 
171  virtual void overload(PRMAttribute< GUM_SCALAR >* source);
172 
174 
175  protected:
177 
178  virtual PRMType* _type() = 0;
179  virtual void _type(PRMType* t) = 0;
180  };
181 
182 
183 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
184  extern template class PRMAttribute< double >;
185 #endif
186 
187 
188  } /* namespace prm */
189 } // namespace gum
190 
192 
193 #endif /* GUM_ATTRIBUTE_H */
aGrUM&#39;s Potential is a multi-dimensional array with tensor operators.
Definition: potential.h:60
virtual PRMAttribute< GUM_SCALAR > * getCastDescendant() const =0
Returns a proper cast descendant of this PRMAttribute.
PRMAttribute(const std::string &name)
Destructor.
virtual void addParent(const PRMClassElement< GUM_SCALAR > &elt)=0
See gum::PRMClassElement::_addParent().
const std::string & name() const
Returns the name of this object.
Definition: PRMObject_inl.h:35
virtual PRMAttribute< GUM_SCALAR > * copy(Bijection< const DiscreteVariable *, const DiscreteVariable * > bij) const =0
See gum::PRMClassElement::elt_type().
virtual PRMAttribute< GUM_SCALAR > * newFactory(const PRMClass< GUM_SCALAR > &c) const =0
See gum::PRMClassElement::elt_type().
virtual PRMType & type()=0
See gum::PRMClassElement::type().
Abstract class representing an element of PRM class.
virtual ~PRMAttribute()
Destructor.
virtual PRMType * _type()=0
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual void becomeCastDescendant(PRMType &subtype)=0
Change this attribute to be a cast descendant of a an attribute with type subtype.
virtual void overload(PRMAttribute< GUM_SCALAR > *source)
Set this as overload of source (necessayr to preserver internal pointers for MultiDims).
virtual const Potential< GUM_SCALAR > & cpf() const =0
See gum::PRMClassElement::cpf().
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 PRMClassElement< GUM_SCALAR >::ClassElementType elt_type() const =0
See gum::PRMClassElement::elt_type().
virtual void addChild(const PRMClassElement< GUM_SCALAR > &elt)=0
See gum::PRMClassElement::_addChild().
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual void swap(const PRMType &old_type, const PRMType &new_type)=0
Swap old_type with new_type in the PRMClassElement cpt.
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)=0
Define attr as a cast descendant of this PRMAttribute.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual void copyCpf(const Bijection< const DiscreteVariable *, const DiscreteVariable * > &bif, const PRMAttribute< GUM_SCALAR > &source)=0
See gum::PRMClassElement::elt_type().
PRMAttribute is a member of a Class in a PRM.
Definition: PRMAttribute.h:61
ClassElementType
Returns true if obj_ptr is of type PRMReferenceSlot.