![]() |
aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
|
This class is an implementation of the Structured Value Elimination algorithm on PRM<GUM_SCALAR>. More...
#include <agrum/PRM/SVED.h>
Public Member Functions | |
Constructors & destructor. | |
SVED (const PRM< GUM_SCALAR > &prm, const PRMSystem< GUM_SCALAR > &model) | |
Default Constructor. More... | |
~SVED () | |
Destructor. More... | |
Getters & setters. | |
virtual std::string | name () const |
Returns the name of the current inference algorithm. More... | |
Query methods. | |
void | posterior (const Chain &chain, Potential< GUM_SCALAR > &m) |
Compute the posterior of the formal attribute pointed by chain and stores it in m. More... | |
void | joint (const std::vector< Chain > &chains, Potential< GUM_SCALAR > &j) |
Compute the joint probability of the formals attributes pointed by chains and stores it in m. More... | |
Evidence handling. | |
EMap & | evidence (const PRMInstance< GUM_SCALAR > &i) |
Returns EMap of evidences over i. More... | |
EMap & | evidence (const PRMInstance< GUM_SCALAR > *i) |
Returns EMap of evidences over i. More... | |
const EMap & | evidence (const PRMInstance< GUM_SCALAR > &i) const |
Returns EMap of evidences over i. More... | |
const EMap & | evidence (const PRMInstance< GUM_SCALAR > *i) const |
Returns EMap of evidences over i. More... | |
bool | hasEvidence (const PRMInstance< GUM_SCALAR > &i) const |
Returns true if i has evidence. More... | |
bool | hasEvidence (const PRMInstance< GUM_SCALAR > *i) const |
Returns EMap of evidences over i. More... | |
bool | hasEvidence (const Chain &chain) const |
Returns true if i has evidence on PRMAttribute<GUM_SCALAR> a. More... | |
bool | hasEvidence () const |
Returns true if i has evidence on PRMAttribute<GUM_SCALAR> a. More... | |
void | addEvidence (const Chain &chain, const Potential< GUM_SCALAR > &p) |
Add an evidence to the given instance's elt. More... | |
void | removeEvidence (const Chain &chain) |
Remove evidence on the given instance's elt. More... | |
void | clearEvidence () |
Remove all evidences. More... | |
Public Types | |
typedef NodeProperty< const Potential< GUM_SCALAR > *> | EMap |
Code alias. More... | |
typedef NodeProperty< const Potential< GUM_SCALAR > *>::iterator_safe | EMapIterator |
Code alias. More... | |
typedef NodeProperty< const Potential< GUM_SCALAR > *>::const_iterator_safe | EMapConstIterator |
Code alias. More... | |
Protected Attributes | |
Protected members. | |
PRM< GUM_SCALAR > const * | prm_ |
The PRM<GUM_SCALAR> on which inference is done. More... | |
PRMSystem< GUM_SCALAR > const * | sys_ |
The Model on which inference is done. More... | |
Query methods. | |
typedef PRMInference< GUM_SCALAR >::Chain | Chain |
Code alias. More... | |
virtual void | evidenceAdded_ (const Chain &chain) |
See PRMInference::evidenceAdded_(). More... | |
virtual void | evidenceRemoved_ (const Chain &chain) |
See PRMInference::evidenceRemoved_(). More... | |
virtual void | posterior_ (const Chain &chain, Potential< GUM_SCALAR > &m) |
See PRMInference::posterior_(). More... | |
virtual void | joint_ (const std::vector< Chain > &queries, Potential< GUM_SCALAR > &j) |
See PRMInference::joint_(). More... | |
This class is an implementation of the Structured Value Elimination algorithm on PRM<GUM_SCALAR>.
|
private |
|
private |
|
private |
|
protected |
|
inherited |
Code alias.
Definition at line 58 of file PRMInference.h.
|
inherited |
Code alias.
Definition at line 65 of file PRMInference.h.
|
inherited |
Code alias.
Definition at line 61 of file PRMInference.h.
INLINE gum::prm::SVED< GUM_SCALAR >::SVED | ( | const PRM< GUM_SCALAR > & | prm, |
const PRMSystem< GUM_SCALAR > & | model | ||
) |
Default Constructor.
Definition at line 472 of file SVED_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
gum::prm::SVED< GUM_SCALAR >::~SVED | ( | ) |
Destructor.
Definition at line 34 of file SVED_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
private |
Returns true if second can be eliminated before first.
Definition at line 501 of file SVED_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
private |
Returns true if second can be eliminated before first.
Definition at line 44 of file SVED_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
private |
Returns true if second can be eliminated before first.
Definition at line 109 of file SVED_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
private |
Returns true if second can be eliminated before first.
Definition at line 177 of file SVED_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
private |
Returns true if second can be eliminated before first.
Definition at line 244 of file SVED_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
private |
Returns true if second can be eliminated before first.
Definition at line 512 of file SVED_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
private |
Returns true if second can be eliminated before first.
Definition at line 530 of file SVED_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
private |
Returns true if second can be eliminated before first.
Definition at line 489 of file SVED_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
private |
Returns true if second can be eliminated before first.
Definition at line 540 of file SVED_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
private |
Returns true if second can be eliminated before first.
Definition at line 349 of file SVED_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
private |
Returns true if second can be eliminated before first.
Definition at line 286 of file SVED_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
private |
Returns true if second can be eliminated before first.
Definition at line 442 of file SVED_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
private |
Returns true if second can be eliminated before first.
Definition at line 481 of file SVED_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
private |
Returns true if second can be eliminated before first.
Definition at line 266 of file SVED_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
private |
Returns true if second can be eliminated before first.
Definition at line 551 of file SVED_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
private |
Returns true if second can be eliminated before first.
Definition at line 494 of file SVED_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
inherited |
Add an evidence to the given instance's elt.
chain | The variable being observed. |
p | The Potential added (by copy) as evidence. |
NotFound | Raised if elt does not belong to i. |
OperationNotAllowed | Raised if p is inconsistent with elt. |
Definition at line 105 of file PRMInference_tpl.h.
|
inherited |
Remove all evidences.
Definition at line 35 of file PRMInference_tpl.h.
|
inherited |
Returns EMap of evidences over i.
NotFound | if i has no evidence. |
Definition at line 151 of file PRMInference_tpl.h.
|
inherited |
Returns EMap of evidences over i.
NotFound | if i has no evidence. |
Definition at line 167 of file PRMInference_tpl.h.
|
inherited |
Returns EMap of evidences over i.
NotFound | if i has no evidence. |
Definition at line 159 of file PRMInference_tpl.h.
|
inherited |
Returns EMap of evidences over i.
NotFound | if i has no evidence. |
Definition at line 175 of file PRMInference_tpl.h.
|
protectedvirtual |
See PRMInference::evidenceAdded_().
Implements gum::prm::PRMInference< GUM_SCALAR >.
Definition at line 519 of file SVED_tpl.h.
|
protectedvirtual |
See PRMInference::evidenceRemoved_().
Implements gum::prm::PRMInference< GUM_SCALAR >.
Definition at line 525 of file SVED_tpl.h.
|
inherited |
Returns true if i has evidence.
Definition at line 182 of file PRMInference_tpl.h.
|
inherited |
Returns EMap of evidences over i.
Definition at line 187 of file PRMInference_tpl.h.
|
inherited |
Returns true if i has evidence on PRMAttribute<GUM_SCALAR> a.
Definition at line 192 of file PRMInference_tpl.h.
|
inherited |
Returns true if i has evidence on PRMAttribute<GUM_SCALAR> a.
Definition at line 197 of file PRMInference_tpl.h.
|
inherited |
Compute the joint probability of the formals attributes pointed by chains and stores it in m.
chains | A Set of strings of the form instance.attribute. |
j | An empty CPF which will be filed by the joint probability over chains. |
NotFound | Raised if some chain in chains does not point to a formal attribute. |
OperationNotAllowed | Raise if m is not empty. |
Definition at line 241 of file PRMInference_tpl.h.
|
protectedvirtual |
Implements gum::prm::PRMInference< GUM_SCALAR >.
Definition at line 436 of file SVED_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
virtual |
Returns the name of the current inference algorithm.
Implements gum::prm::PRMInference< GUM_SCALAR >.
Definition at line 571 of file SVED_tpl.h.
|
inherited |
Compute the posterior of the formal attribute pointed by chain and stores it in m.
chain | A string of the form instance.attribute. |
m | An empty CPF which will be filed by the posterior of chain. |
NotFound | Raised if chain is invalid. |
TypeError | Raised if chain does not point to an PRMAttribute<GUM_SCALAR>. |
OperationNotAllowed | Raise if m is not empty. |
Definition at line 215 of file PRMInference_tpl.h.
|
protectedvirtual |
See PRMInference::posterior_().
Implements gum::prm::PRMInference< GUM_SCALAR >.
Definition at line 386 of file SVED_tpl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
inherited |
Remove evidence on the given instance's elt.
chain | The variable being observed. |
NotFound | Raised if the given names are not found. |
TypeError | Raised if the elt is not an PRMAttribute<GUM_SCALAR>. |
Definition at line 202 of file PRMInference_tpl.h.
|
private |
|
private |
|
private |
|
private |
The Set<NodeId> returned by StructuredBayesBall<GUM_SCALAR> is unique for each family of instances with the same requisite set (thus the same lifted potentials).
|
protectedinherited |
The PRM<GUM_SCALAR> on which inference is done.
Definition at line 207 of file PRMInference.h.
|
protectedinherited |
The Model on which inference is done.
Definition at line 210 of file PRMInference.h.