71 template <
typename GUM_SCALAR >
92 virtual std::string
name()
const;
115 virtual void joint_(
const std::vector< Chain >& queries, Tensor< GUM_SCALAR >& j);
136 StructuredBayesBall< GUM_SCALAR >
_bb_;
200 std::string
_trim_(
const std::string& s);
205#ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
Inline implementation of SVED.
Headers of ClassBayesNet<GUM_SCALAR>.
Headers of ClassDependencyGraph<GUM_SCALAR>.
The class for generic Hash Tables.
Generic doubly linked lists.
A PRMClass is an object of a PRM representing a fragment of a Bayesian network which can be instantia...
std::pair< const PRMInstance< GUM_SCALAR > *, const PRMAttribute< GUM_SCALAR > * > Chain
Code alias.
PRMInference(const PRM< GUM_SCALAR > &prm, const PRMSystem< GUM_SCALAR > &system)
Default constructor.
An PRMInstance is a Bayesian network fragment defined by a Class and used in a PRMSystem.
A PRMSystem is a container of PRMInstance and describe a relational skeleton.
This class represents a Probabilistic Relational PRMSystem<GUM_SCALAR>.
This class is an implementation of the Structured Value Elimination algorithm on PRM<GUM_SCALAR>.
std::string _trim_(const std::string &s)
Returns true if second can be eliminated before first.
HashTable< const PRMClass< GUM_SCALAR > *, std::vector< NodeId > * > _elim_orders_
virtual void evidenceAdded_(const Chain &chain)
See PRMInference::evidenceAdded_().
Set< Tensor< GUM_SCALAR > * > BucketSet
Code alias.
virtual void joint_(const std::vector< Chain > &queries, Tensor< GUM_SCALAR > &j)
See PRMInference::joint_().
void _eliminateNodesUpward_(const PRMInstance< GUM_SCALAR > *i, BucketSet &pool, BucketSet &trash, List< const PRMInstance< GUM_SCALAR > * > &elim_list, Set< const PRMInstance< GUM_SCALAR > * > &ignore)
Returns true if second can be eliminated before first.
std::vector< NodeId > & _getElimOrder_(const PRMClass< GUM_SCALAR > &c)
Returns true if second can be eliminated before first.
void _insertEvidence_(const PRMInstance< GUM_SCALAR > *i, BucketSet &pool)
Returns true if second can be eliminated before first.
virtual void evidenceRemoved_(const Chain &chain)
See PRMInference::evidenceRemoved_().
virtual void posterior_(const Chain &chain, Tensor< GUM_SCALAR > &m)
See PRMInference::posterior_().
void _initLiftedNodes_(const PRMInstance< GUM_SCALAR > *i, BucketSet &trash)
Returns true if second can be eliminated before first.
void _reduceElimList_(const PRMInstance< GUM_SCALAR > *i, List< const PRMInstance< GUM_SCALAR > * > &elim_list, List< const PRMInstance< GUM_SCALAR > * > &reduced_list, Set< const PRMInstance< GUM_SCALAR > * > &ignore, BucketSet &pool, BucketSet &trash)
Returns true if second can be eliminated before first.
HashTable< const Set< NodeId > *, BucketSet * > _lifted_pools_
The Set<NodeId> returned by StructuredBayesBall<GUM_SCALAR> is unique for each family of instances wi...
Set< NodeId > & _getAttrSet_(const PRMInstance< GUM_SCALAR > *i)
Returns true if second can be eliminated before first.
Sequence< std::string > * _class_elim_order_
void _eliminateNodesWithEvidence_(const PRMInstance< GUM_SCALAR > *i, BucketSet &pool, BucketSet &trash)
Returns true if second can be eliminated before first.
Tensor< GUM_SCALAR > * _getAggTensor_(const PRMInstance< GUM_SCALAR > *i, const PRMAggregate< GUM_SCALAR > *agg)
Returns true if second can be eliminated before first.
void _initElimOrder_()
Returns true if second can be eliminated before first.
virtual std::string name() const
Returns the name of the current inference algorithm.
typename Set< Tensor< GUM_SCALAR > * >::iterator_safe BucketSetIterator
typename Set< MultiDimArray< GUM_SCALAR > * >::iterator_safe ArraySetIterator
HashTable< const Set< NodeId > *, std::pair< Set< NodeId > *, Set< NodeId > * > > _req_set_
First pair -> requisite Attributes Second pair -> requisite SlotChains.
SVED(const PRM< GUM_SCALAR > &prm, const PRMSystem< GUM_SCALAR > &model)
Default Constructor.
Set< NodeId > & _getSCSet_(const PRMInstance< GUM_SCALAR > *i)
Returns true if second can be eliminated before first.
bool _checkElimOrder_(const PRMInstance< GUM_SCALAR > *first, const PRMInstance< GUM_SCALAR > *second)
Returns true if second can be eliminated before first.
void _insertLiftedNodes_(const PRMInstance< GUM_SCALAR > *i, BucketSet &pool, BucketSet &trash)
Returns true if second can be eliminated before first.
void _eliminateNodes_(const PRMInstance< GUM_SCALAR > *query, NodeId id, BucketSet &pool, BucketSet &trash)
Returns true if second can be eliminated before first.
typename PRMInference< GUM_SCALAR >::Chain Chain
Code alias.
void _eliminateNodesDownward_(const PRMInstance< GUM_SCALAR > *from, const PRMInstance< GUM_SCALAR > *i, BucketSet &pool, BucketSet &trash, List< const PRMInstance< GUM_SCALAR > * > &elim_list, Set< const PRMInstance< GUM_SCALAR > * > &ignore)
Returns true if second can be eliminated before first.
StructuredBayesBall< GUM_SCALAR > _bb_
void _initReqSets_(const PRMInstance< GUM_SCALAR > *i)
Returns true if second can be eliminated before first.
Size NodeId
Type for node ids.
Headers of InstanceBayesNet.
namespace for all probabilistic relational models entities
gum is the global namespace for all aGrUM entities
class for graph triangulations for which we enforce a given partial ordering on the nodes elimination...
Headers of StructuredBayesBall.
Implementation of a variable elimination algorithm for inference in Bayesian networks.