|
ADS-IDAC Engine 5.0.0
|
Cliques and separators compiled from one Graph. More...
#include <junction_tree.hpp>
Public Member Functions | |
| JunctionTree (const Graph *graph) | |
| void | add_clique (const std::vector< NodeId > &scope, const std::vector< std::size_t > &state_sizes) |
| Appends a clique. Its id is the number of cliques before the call. More... | |
| void | add_separator (std::size_t c1, std::size_t c2, const std::vector< NodeId > &scope) |
| Appends a separator and records each clique as a neighbor of the other. More... | |
| const Graph * | graph () const |
| The graph given at construction. More... | |
| const std::vector< Clique > & | cliques () const |
| All cliques, indexed by Clique::id. More... | |
| const std::vector< Separator > & | separators () const |
| All separators, in the order they were added. More... | |
| std::vector< Clique > & | get_mutable_cliques () |
| Writable access to the cliques, used by the compiler to fill potentials and CPT assignments. More... | |
Private Attributes | |
| const Graph * | graph_ |
| not owned More... | |
| std::vector< Clique > | cliques_ |
| std::vector< Separator > | separators_ |
Cliques and separators compiled from one Graph.
The tree stores a pointer to its graph and does not own it. The graph must outlive the tree and every BatchWorkspace or BatchExecutionEngine built on it, because the workspaces read variable metadata and CPTs through this pointer. When the graph has unconnected parts, the structure is a forest with one tree per part.
Definition at line 49 of file junction_tree.hpp.
|
explicit |
| graph | Graph the tree describes. Not owned, must stay valid. |
Definition at line 5 of file junction_tree.cpp.
| void bncore::JunctionTree::add_clique | ( | const std::vector< NodeId > & | scope, |
| const std::vector< std::size_t > & | state_sizes | ||
| ) |
Appends a clique. Its id is the number of cliques before the call.
| scope | Variables of the clique. |
| state_sizes | State count of each scope variable, in scope order. |
Definition at line 7 of file junction_tree.cpp.
References cliques_.
| void bncore::JunctionTree::add_separator | ( | std::size_t | c1, |
| std::size_t | c2, | ||
| const std::vector< NodeId > & | scope | ||
| ) |
Appends a separator and records each clique as a neighbor of the other.
| c1 | Index of an existing clique. It is not checked. |
| c2 | Index of another existing clique. It is not checked. |
| scope | Variables shared by the two cliques. |
Definition at line 13 of file junction_tree.cpp.
References cliques_, and separators_.
|
inline |
All cliques, indexed by Clique::id.
Definition at line 72 of file junction_tree.hpp.
References cliques_.
Referenced by bncore::BatchWorkspace::BatchWorkspace(), bncore::BatchWorkspace::build_message_schedule(), bncore::BatchWorkspace::build_node_to_clique_map(), bncore::BatchWorkspace::calibrate(), bncore::BatchWorkspace::max_calibrate(), bncore::BatchWorkspace::query_map(), bncore::BatchWorkspace::query_marginals_multi(), bncore::BatchWorkspace::rebuild_clique_potentials(), and bncore::BatchWorkspace::resize_runtime_buffers().
|
inline |
Writable access to the cliques, used by the compiler to fill potentials and CPT assignments.
Definition at line 80 of file junction_tree.hpp.
References cliques_.
|
inline |
The graph given at construction.
Definition at line 70 of file junction_tree.hpp.
References graph_.
Referenced by bncore::BatchWorkspace::apply_soft_evidence_to_clique(), bncore::BatchExecutionEngine::apply_soft_evidence_to_workspace(), bncore::BatchWorkspace::build_message_schedule(), bncore::BatchExecutionEngine::evaluate(), bncore::BatchExecutionEngine::evaluate_map(), bncore::BatchWorkspace::query_map(), bncore::BatchWorkspace::query_marginal(), bncore::BatchWorkspace::query_marginals_multi(), bncore::BatchWorkspace::rebuild_clique_potentials(), bncore::BatchWorkspace::set_soft_evidence(), and bncore::BatchWorkspace::set_soft_evidence_matrix().
|
inline |
All separators, in the order they were added.
Definition at line 74 of file junction_tree.hpp.
References separators_.
|
private |
Definition at line 84 of file junction_tree.hpp.
Referenced by add_clique(), add_separator(), cliques(), and get_mutable_cliques().
|
private |
|
private |
Definition at line 85 of file junction_tree.hpp.
Referenced by add_separator(), and separators().