59 void add_clique(
const std::vector<NodeId> &scope,
60 const std::vector<std::size_t> &state_sizes);
67 const std::vector<NodeId> &scope);
74 [[nodiscard]]
const std::vector<Separator> &
separators()
const {
A potential over an ordered scope of variables.
Directed graphical model over discrete variables.
Cliques and separators compiled from one Graph.
const Graph * graph_
not owned
const std::vector< Separator > & separators() const
All separators, in the order they were added.
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.
const std::vector< Clique > & cliques() const
All cliques, indexed by Clique::id.
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.
std::vector< Clique > cliques_
const Graph * graph() const
The graph given at construction.
std::vector< Clique > & get_mutable_cliques()
Writable access to the cliques, used by the compiler to fill potentials and CPT assignments.
std::vector< Separator > separators_
bncore::Factor, a table of doubles over a list of variables, with the product and sum-out operations ...
bncore::Graph, the discrete Bayesian network model: variables, their states, directed edges and condi...
One clique of a junction tree.
std::vector< std::size_t > neighbor_cliques
indices of adjacent cliques
std::vector< NodeId > assigned_cpts
std::vector< NodeId > scope
One edge of a junction tree, with the variables its cliques share.
std::size_t clique2
index of the other end
std::vector< NodeId > scope
variables common to both cliques
std::size_t clique1
index of one end