30 #ifndef GUM_PRM_INFERENCE_H 31 #define GUM_PRM_INFERENCE_H 51 template <
typename GUM_SCALAR >
55 typedef std::pair< const PRMInstance< GUM_SCALAR >*,
96 virtual std::string
name()
const = 0;
209 virtual void _joint(
const std::vector< Chain >& queries,
231 typename HashTable< const PRMInstance< GUM_SCALAR >*,
244 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS aGrUM's Potential is a multi-dimensional array with tensor operators.
HashTable< const PRMInstance< GUM_SCALAR > *, EMap *> __evidences
Mapping of evidence over PRMInstance<GUM_SCALAR>'s nodes.
EMap & evidence(const PRMInstance< GUM_SCALAR > &i)
Returns EMap of evidences over i.
An PRMInstance is a Bayesian Network fragment defined by a Class and used in a PRMSystem.
virtual void _marginal(const Chain &chain, Potential< GUM_SCALAR > &m)=0
Generic method to compute the marginal of given element.
HashTable< const PRMInstance< GUM_SCALAR > *, EMap *>::const_iterator_safe EvidenceConstIterator
Code alias.
HashTable< const PRMInstance< GUM_SCALAR > *, EMap *>::iterator_safe EvidenceIterator
Code alias.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
PRMInference(const PRM< GUM_SCALAR > &prm, const PRMSystem< GUM_SCALAR > &system)
Default constructor.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
NodeProperty< const Potential< GUM_SCALAR > *>::iterator_safe EMapIterator
Code alias.
PRM< GUM_SCALAR > const * _prm
The PRM<GUM_SCALAR> on which inference is done.
virtual void _evidenceRemoved(const Chain &chain)=0
This method is called whenever an evidence is removed, but BEFORE any processing made by PRMInference...
The class for generic Hash Tables.
void marginal(const Chain &chain, Potential< GUM_SCALAR > &m)
Compute the marginal of the formal attribute pointed by chain and stores it in m. ...
virtual void _evidenceAdded(const Chain &chain)=0
This method is called whenever an evidence is added, but AFTER any processing made by PRMInference...
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
EMap & __EMap(const PRMInstance< GUM_SCALAR > *i)
Private getter over __evidences, if necessary creates an EMap for i.
void clearEvidence()
Remove all evidences.
A PRMSystem is a container of PRMInstance and describe a relational skeleton.
NodeProperty< const Potential< GUM_SCALAR > *>::const_iterator_safe EMapConstIterator
Code alias.
bool hasEvidence() const
Returns true if i has evidence on PRMAttribute<GUM_SCALAR> a.
PRMSystem< GUM_SCALAR > const * _sys
The Model on which inference is done.
std::pair< const PRMInstance< GUM_SCALAR > *, const PRMAttribute< GUM_SCALAR > *> Chain
Code alias.
This abstract class is used as base class for all inference class on PRM<GUM_SCALAR>.
This class represents a Probabilistic Relational PRMSystem<GUM_SCALAR>.
void joint(const std::vector< Chain > &chains, Potential< GUM_SCALAR > &j)
Compute the joint probability of the formals attributes pointed by chains and stores it in m...
void addEvidence(const Chain &chain, const Potential< GUM_SCALAR > &p)
Add an evidence to the given instance's elt.
virtual std::string name() const =0
Returns the name of the current inference algorithm.
NodeProperty< const Potential< GUM_SCALAR > *> EMap
Code alias.
virtual void _joint(const std::vector< Chain > &queries, Potential< GUM_SCALAR > &j)=0
Generic method to compute the marginal of given element.
PRMAttribute is a member of a Class in a PRM.
void removeEvidence(const Chain &chain)
Remove evidence on the given instance's elt.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual ~PRMInference()
Destructor.
PRMInference & operator=(const PRMInference &source)
Copy operator.