30 #ifndef GUM_MARKOV_NET_MARGINAL_TARGETED_INFERENCE_H 31 #define GUM_MARKOV_NET_MARGINAL_TARGETED_INFERENCE_H 35 #include <agrum/MN/inference/tools/MarkovNetInference.h> 36 #include <agrum/agrum.h> 55 template <
typename GUM_SCALAR >
133 virtual void addTarget(NodeId target)
final;
139 virtual void addTarget(
const std::string& nodeName)
final;
149 virtual void eraseTarget(
const std::string& nodeName)
final;
152 virtual bool isTarget(NodeId node)
const final;
155 virtual bool isTarget(
const std::string& nodeName)
const final;
174 virtual GUM_SCALAR
H(NodeId X)
final;
180 virtual GUM_SCALAR
H(
const std::string& nodeName)
final;
256 #include <agrum/MN/inference/tools/marginalTargetedMNInference_tpl.h> 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 addTarget(const std::string &nodeName) final
Add a marginal target to the list of targets.
virtual void onModelChanged_(const GraphicalModel *mn)
fired after a new Markov net has been assigned to the engine
virtual bool isTarget(const std::string &nodeName) const final
return true if variable is a (marginal) target
virtual const Potential< GUM_SCALAR > & posterior(const std::string &nodeName)
Computes and returns the posterior of a node.
virtual GUM_SCALAR H(const std::string &nodeName) final
Entropy Compute Shanon's entropy of a node given the observation.
INLINE void emplace(Args &&... args)
virtual const NodeSet & targets() const noexcept final
returns the list of marginal targets
virtual ~MarginalTargetedMNInference()
destructor
void _setAllMarginalTargets_()
sets all the nodes of the Markov net as targets
virtual void onMarginalTargetAdded_(const NodeId id)=0
fired after a new marginal target is inserted
virtual void eraseTarget(const std::string &nodeName) final
removes an existing (marginal) target
NodeSet _targets_
the set of marginal targets
Potential< GUM_SCALAR > evidenceImpact(const std::string &target, const std::vector< std::string > &evs)
Create a gum::Potential for P(target|evs) (for all instanciation of target and evs) ...
virtual bool isTarget(NodeId node) const final
return true if variable is a (marginal) target
virtual GUM_SCALAR H(NodeId X) final
Entropy Compute Shanon's entropy of a node given the observation.
virtual void onAllMarginalTargetsAdded_()=0
fired after all the nodes of the MN are added as marginal targets
virtual const Size nbrTargets() const noexcept final
returns the number of marginal targets
<agrum/MN/inference/marginalTargetedMNInference.h>
virtual void eraseAllTargets()
Clear all previously defined targets.
virtual void addTarget(NodeId target) final
Add a marginal target to the list of targets.
virtual void onAllMarginalTargetsErased_()=0
fired before a all marginal targets are removed
bool isTargetedMode_() const
virtual const Potential< GUM_SCALAR > & posterior(NodeId node)
Computes and returns the posterior of a node.
virtual void eraseTarget(NodeId target) final
removes an existing (marginal) target
virtual void addAllTargets() final
adds all nodes as targets
virtual const Potential< GUM_SCALAR > & posterior_(NodeId id)=0
asks derived classes for the posterior of a given variable
bool _targeted_mode_
whether the actual targets are default
MarginalTargetedMNInference(const IMarkovNet< GUM_SCALAR > *mn)
default constructor
virtual void onMarginalTargetErased_(const NodeId id)=0
fired before a marginal target is removed