31 #ifndef GUM_BAYES_NET_MARGINAL_TARGETED_INFERENCE_H 32 #define GUM_BAYES_NET_MARGINAL_TARGETED_INFERENCE_H 56 template <
typename GUM_SCALAR >
57 class MarginalTargetedInference
58 :
public virtual BayesNetInference< GUM_SCALAR > {
115 virtual const Potential< GUM_SCALAR >&
posterior(
const std::string& nodeName);
141 virtual
void addTarget(const
std::
string& nodeName) final;
157 virtual
bool isTarget(const
std::
string& nodeName) const final;
176 virtual GUM_SCALAR
H(
NodeId X) final;
182 virtual GUM_SCALAR
H(const
std::
string& nodeName) final;
211 const
std::vector<
std::
string >& evs);
258 #include <agrum/BN/inference/tools/marginalTargetedInference_tpl.h> 261 #endif // GUM_BAYES_NET_MARGINAL_TARGETED_INFERENCE_H virtual void _onBayesNetChanged(const IBayesNet< GUM_SCALAR > *bn)
fired after a new Bayes net has been assigned to the engine
virtual GUM_SCALAR H(NodeId X) final
Entropy Compute Shanon's entropy of a node given the observation.
NodeSet __targets
the set of marginal targets
virtual void eraseTarget(NodeId target) final
removes an existing (marginal) target
Set< NodeId > NodeSet
Some typdefs and define for shortcuts ...
virtual void _onMarginalTargetAdded(const NodeId id)=0
fired after a new marginal target is inserted
virtual const Size nbrTargets() const noexcept final
returns the number of marginal targets
virtual bool isTarget(NodeId node) const final
return true if variable is a (marginal) target
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual void _onAllMarginalTargetsErased()=0
fired before a all marginal targets are removed
virtual void addTarget(NodeId target) final
Add a marginal target to the list of targets.
void __setAllMarginalTargets()
sets all the nodes of the Bayes net as targets
virtual void addAllTargets() final
adds all nodes as targets
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual const Potential< GUM_SCALAR > & posterior(NodeId node)
Computes and returns the posterior of a node.
virtual void _onMarginalTargetErased(const NodeId id)=0
fired before a marginal target is removed
Potential< GUM_SCALAR > evidenceImpact(NodeId target, const NodeSet &evs)
Create a gum::Potential for P(target|evs) (for all instanciation of target and evs) ...
virtual void _onAllMarginalTargetsAdded()=0
fired after all the nodes of the BN are added as marginal targets
virtual const Potential< GUM_SCALAR > & _posterior(NodeId id)=0
asks derived classes for the posterior of a given variable
virtual const NodeSet & targets() const noexcept final
returns the list of marginal targets
virtual void eraseAllTargets()
Clear all previously defined targets.
bool _isTargetedMode() const
std::size_t Size
In aGrUM, hashed values are unsigned long int.
bool __targeted_mode
whether the actual targets are default
virtual ~MarginalTargetedInference()
destructor
Size NodeId
Type for node ids.
MarginalTargetedInference(const IBayesNet< GUM_SCALAR > *bn)
default constructor