28 #ifndef GUM_BAYES_NET_MARGINAL_TARGETED_INFERENCE_H 29 #define GUM_BAYES_NET_MARGINAL_TARGETED_INFERENCE_H 53 template <
typename GUM_SCALAR >
54 class MarginalTargetedInference
55 :
public virtual BayesNetInference< GUM_SCALAR > {
112 virtual const Potential< GUM_SCALAR >&
posterior(
const std::string& nodeName);
138 virtual
void addTarget(const
std::
string& nodeName) final;
154 virtual
bool isTarget(const
std::
string& nodeName) const final;
173 virtual GUM_SCALAR
H(
NodeId X) final;
179 virtual GUM_SCALAR
H(const
std::
string& nodeName) final;
208 const
std::vector<
std::
string >& evs);
255 #include <agrum/BN/inference/tools/marginalTargetedInference_tpl.h> 258 #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
gum is the global namespace for all aGrUM entities
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
This file contains abstract class definitions for Bayesian networks inference classes.
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