![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
Detect barren nodes for inference in Bayesian networks. More...
#include <barrenNodesFinder.h>
Public Member Functions | |
Constructors / Destructors | |
| BarrenNodesFinder (const DAG *dag) | |
| default constructor | |
| BarrenNodesFinder (const BarrenNodesFinder &from) | |
| copy constructor | |
| BarrenNodesFinder (BarrenNodesFinder &&from) noexcept | |
| move constructor | |
| ~BarrenNodesFinder () | |
| destructor | |
Operators | |
| BarrenNodesFinder & | operator= (const BarrenNodesFinder &from) |
| copy operator | |
| BarrenNodesFinder & | operator= (BarrenNodesFinder &&from) |
| move operator | |
Accessors / Modifiers | |
| void | setDAG (const DAG *new_dag) |
| sets a new DAG | |
| void | setEvidence (const NodeSet *observed_nodes) |
| sets the observed nodes in the DAG | |
| void | setTargets (const NodeSet *target_nodes) |
| sets the set of target nodes we are interested in | |
| NodeSet | barrenNodes () |
| returns the set of barren nodes | |
| ArcProperty< NodeSet > | barrenNodes (const CliqueGraph &junction_tree) |
| returns the set of barren nodes in the messages sent in a junction tree | |
| template<typename GUM_SCALAR> | |
| ArcProperty< Set< const Tensor< GUM_SCALAR > * > > | barrenTensors (const CliqueGraph &junction_tree, const IBayesNet< GUM_SCALAR > &bn) |
| returns the set of barren tensors in messages sent in a junction tree | |
Private Attributes | |
| const DAG * | _dag_ |
| the DAG on which we compute the barren nodes | |
| const NodeSet * | _observed_nodes_ |
| the set of observed nodes | |
| const NodeSet * | _target_nodes_ |
| the set of targeted nodes | |
Detect barren nodes for inference in Bayesian networks.
Definition at line 65 of file barrenNodesFinder.h.
|
explicit |
default constructor
Definition at line 46 of file barrenNodesFinder_inl.h.
References BarrenNodesFinder(), and _dag_.
Referenced by BarrenNodesFinder(), BarrenNodesFinder(), BarrenNodesFinder(), ~BarrenNodesFinder(), operator=(), and operator=().
| INLINE gum::BarrenNodesFinder::BarrenNodesFinder | ( | const BarrenNodesFinder & | from | ) |
copy constructor
Definition at line 52 of file barrenNodesFinder_inl.h.
References BarrenNodesFinder(), _dag_, _observed_nodes_, and _target_nodes_.
|
noexcept |
move constructor
Definition at line 59 of file barrenNodesFinder_inl.h.
References BarrenNodesFinder(), _dag_, _observed_nodes_, and _target_nodes_.
| INLINE gum::BarrenNodesFinder::~BarrenNodesFinder | ( | ) |
destructor
Definition at line 67 of file barrenNodesFinder_inl.h.
References BarrenNodesFinder().
| NodeSet gum::BarrenNodesFinder::barrenNodes | ( | ) |
returns the set of barren nodes
Definition at line 307 of file barrenNodesFinder.cpp.
References _dag_, _observed_nodes_, _target_nodes_, gum::List< Val >::empty(), gum::List< Val >::front(), gum::List< Val >::insert(), gum::Set< Key >::insert(), and gum::List< Val >::popFront().
Referenced by barrenTensors(), and gum::SamplingInference< GUM_SCALAR >::contextualize().
| ArcProperty< NodeSet > gum::BarrenNodesFinder::barrenNodes | ( | const CliqueGraph & | junction_tree | ) |
returns the set of barren nodes in the messages sent in a junction tree
Definition at line 57 of file barrenNodesFinder.cpp.
References _dag_, _observed_nodes_, gum::DAG::addArc(), gum::Set< Key >::begin(), gum::Set< Key >::beginSafe(), gum::ArcGraphPart::children(), gum::CliqueGraph::clique(), gum::EdgeGraphPart::edges(), gum::List< Val >::empty(), gum::Set< Key >::endSafe(), gum::Set< Key >::erase(), gum::ArcGraphPart::eraseArc(), gum::DiGraph::eraseNode(), gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::exists(), gum::Set< Key >::exists(), gum::Arc::first(), gum::List< Val >::front(), gum::Arc::head(), gum::HashTable< Key, Val >::insert(), gum::List< Val >::insert(), gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::insert(), gum::Set< Key >::insert(), gum::ArcGraphPart::parents(), gum::List< Val >::popFront(), gum::CliqueGraph::separator(), gum::SequenceImplementation< Key, std::is_scalar< Key >::value >::size(), gum::Set< Key >::size(), and gum::Arc::tail().
| ArcProperty< Set< const Tensor< GUM_SCALAR > * > > gum::BarrenNodesFinder::barrenTensors | ( | const CliqueGraph & | junction_tree, |
| const IBayesNet< GUM_SCALAR > & | bn ) |
returns the set of barren tensors in messages sent in a junction tree
Definition at line 47 of file barrenNodesFinder_tpl.h.
References barrenNodes(), gum::IBayesNet< GUM_SCALAR >::cpt(), gum::HashTable< Key, Val >::insert(), and gum::Set< Key >::insert().
| INLINE BarrenNodesFinder & gum::BarrenNodesFinder::operator= | ( | BarrenNodesFinder && | from | ) |
move operator
Definition at line 82 of file barrenNodesFinder_inl.h.
References BarrenNodesFinder(), _dag_, _observed_nodes_, and _target_nodes_.
| INLINE BarrenNodesFinder & gum::BarrenNodesFinder::operator= | ( | const BarrenNodesFinder & | from | ) |
copy operator
Definition at line 72 of file barrenNodesFinder_inl.h.
References BarrenNodesFinder(), _dag_, _observed_nodes_, and _target_nodes_.
| INLINE void gum::BarrenNodesFinder::setDAG | ( | const DAG * | new_dag | ) |
sets a new DAG
Definition at line 92 of file barrenNodesFinder_inl.h.
References _dag_.
| INLINE void gum::BarrenNodesFinder::setEvidence | ( | const NodeSet * | observed_nodes | ) |
sets the observed nodes in the DAG
Definition at line 95 of file barrenNodesFinder_inl.h.
References _observed_nodes_.
Referenced by gum::SamplingInference< GUM_SCALAR >::contextualize().
| INLINE void gum::BarrenNodesFinder::setTargets | ( | const NodeSet * | target_nodes | ) |
sets the set of target nodes we are interested in
Definition at line 100 of file barrenNodesFinder_inl.h.
References _target_nodes_.
Referenced by gum::SamplingInference< GUM_SCALAR >::contextualize().
|
private |
the DAG on which we compute the barren nodes
Definition at line 130 of file barrenNodesFinder.h.
Referenced by BarrenNodesFinder(), BarrenNodesFinder(), BarrenNodesFinder(), barrenNodes(), barrenNodes(), operator=(), operator=(), and setDAG().
|
private |
the set of observed nodes
Definition at line 133 of file barrenNodesFinder.h.
Referenced by BarrenNodesFinder(), BarrenNodesFinder(), barrenNodes(), barrenNodes(), operator=(), operator=(), and setEvidence().
|
private |
the set of targeted nodes
Definition at line 136 of file barrenNodesFinder.h.
Referenced by BarrenNodesFinder(), BarrenNodesFinder(), barrenNodes(), operator=(), operator=(), and setTargets().