73 template < GUM_Numeric GUM_SCALAR >
94 std::string
name()
const override;
117 void joint_(
const std::vector< Chain >& queries, Tensor< GUM_SCALAR >& j)
override;
138 StructuredBayesBall< GUM_SCALAR >
_bb_;
202 std::string
_trim_(std::string_view s);
207#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>.
void _insertEvidence_(const PRMInstance< GUM_SCALAR > *i, BucketSet &pool)
Returns true if second can be eliminated before first.
HashTable< const PRMClass< GUM_SCALAR > *, std::vector< NodeId > * > _elim_orders_
Set< Tensor< GUM_SCALAR > * > BucketSet
Code alias.
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.
void evidenceRemoved_(const Chain &chain) override
See PRMInference::evidenceRemoved_().
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.
void _initLiftedNodes_(const PRMInstance< GUM_SCALAR > *i, 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 > & _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.
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.
Set< NodeId > & _getAttrSet_(const PRMInstance< GUM_SCALAR > *i)
Returns true if second can be eliminated before first.
void _initElimOrder_()
Returns true if second can be eliminated before first.
std::string name() const override
Returns the name of the current inference algorithm.
typename Set< Tensor< GUM_SCALAR > * >::iterator_safe BucketSetIterator
typename Set< MultiDimArray< GUM_SCALAR > * >::iterator_safe ArraySetIterator
~SVED() override
Destructor.
std::vector< NodeId > & _getElimOrder_(const PRMClass< GUM_SCALAR > &c)
Returns true if second can be eliminated before first.
HashTable< const Set< NodeId > *, std::pair< Set< NodeId > *, Set< NodeId > * > > _req_set_
First pair -> requisite Attributes Second pair -> requisite SlotChains.
Tensor< GUM_SCALAR > * _getAggTensor_(const PRMInstance< GUM_SCALAR > *i, const PRMAggregate< GUM_SCALAR > *agg)
Returns true if second can be eliminated before first.
void joint_(const std::vector< Chain > &queries, Tensor< GUM_SCALAR > &j) override
See PRMInference::joint_().
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.
void evidenceAdded_(const Chain &chain) override
See PRMInference::evidenceAdded_().
typename PRMInference< GUM_SCALAR >::Chain Chain
Code alias.
SVED(const PRM< GUM_SCALAR > &prm, const PRMSystem< GUM_SCALAR > &model)
Default Constructor.
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.
void posterior_(const Chain &chain, Tensor< GUM_SCALAR > &m) override
See PRMInference::posterior_().
std::string _trim_(std::string_view s)
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.