![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
#include <binaryJoinTreeConverterDefault.h>
Public Member Functions | |
Constructors / Destructors | |
| BinaryJoinTreeConverterDefault () | |
| default constructor | |
| virtual | ~BinaryJoinTreeConverterDefault () |
| destructor | |
Accessors/Modifiers | |
| CliqueGraph | convert (const CliqueGraph &JT, const NodeProperty< Size > &domain_sizes, const NodeSet &roots) |
| returns a binary join tree corresponding to clique graph JT | |
| const NodeSet & | roots () const |
| returns all the roots considered for all the connected components | |
Private Member Functions | |
| BinaryJoinTreeConverterDefault (const BinaryJoinTreeConverterDefault &) | |
| forbid copy constructor | |
| BinaryJoinTreeConverterDefault & | operator= (const BinaryJoinTreeConverterDefault &) |
| forbid copy operator | |
| void | _markConnectedComponent_ (const CliqueGraph &JT, NodeId root, NodeProperty< bool > &mark) const |
| a function used to mark the nodes belonging to a given connected component | |
| void | _convertConnectedComponent_ (CliqueGraph &JT, NodeId current_node, NodeId from, const NodeProperty< Size > &domain_sizes, NodeProperty< bool > &mark) const |
| convert a whole connected component into a binary join tree | |
| void | _convertClique_ (CliqueGraph &JT, NodeId clique, NodeId from, const NodeProperty< Size > &domain_sizes) const |
| convert a clique and its adjacent cliques into a binary join tree | |
| float | _combinedSize_ (const NodeSet &nodes1, const NodeSet &nodes2, const NodeProperty< Size > &domain_sizes) const |
| returns the domain size of the union of two cliques | |
Private Attributes | |
| NodeSet | _roots_ |
| the new roots that have been created to compute the last query | |
Definition at line 54 of file binaryJoinTreeConverterDefault.h.
| gum::BinaryJoinTreeConverterDefault::BinaryJoinTreeConverterDefault | ( | ) |
default constructor
Definition at line 56 of file binaryJoinTreeConverterDefault.cpp.
References BinaryJoinTreeConverterDefault().
Referenced by BinaryJoinTreeConverterDefault(), BinaryJoinTreeConverterDefault(), ~BinaryJoinTreeConverterDefault(), and operator=().
|
virtual |
destructor
Definition at line 61 of file binaryJoinTreeConverterDefault.cpp.
References BinaryJoinTreeConverterDefault().
|
private |
forbid copy constructor
References BinaryJoinTreeConverterDefault().
|
private |
returns the domain size of the union of two cliques
Definition at line 101 of file binaryJoinTreeConverterDefault.cpp.
References gum::Set< Key >::exists().
Referenced by _convertClique_().
|
private |
convert a clique and its adjacent cliques into a binary join tree
Definition at line 120 of file binaryJoinTreeConverterDefault.cpp.
References _combinedSize_(), gum::CliqueGraph::addEdge(), gum::CliqueGraph::addNode(), gum::PriorityQueueImplementation< Val, Priority, Cmp, Gen >::erase(), gum::CliqueGraph::eraseEdge(), gum::PriorityQueueImplementation< Val, Priority, Cmp, Gen >::insert(), gum::EdgeGraphPart::neighbours(), gum::PriorityQueueImplementation< Val, Priority, Cmp, Gen >::pop(), gum::CliqueGraph::separator(), gum::PriorityQueueImplementation< Val, Priority, Cmp, Gen >::setPriority(), and gum::Set< Key >::size().
Referenced by _convertConnectedComponent_().
|
private |
convert a whole connected component into a binary join tree
Definition at line 237 of file binaryJoinTreeConverterDefault.cpp.
References _convertClique_(), _convertConnectedComponent_(), and gum::EdgeGraphPart::neighbours().
Referenced by _convertConnectedComponent_(), and convert().
|
private |
a function used to mark the nodes belonging to a given connected component
Definition at line 67 of file binaryJoinTreeConverterDefault.cpp.
References gum::EdgeGraphPart::neighbours(), and gum::NodeGraphPart::sizeNodes().
Referenced by convert().
| CliqueGraph gum::BinaryJoinTreeConverterDefault::convert | ( | const CliqueGraph & | JT, |
| const NodeProperty< Size > & | domain_sizes, | ||
| const NodeSet & | roots ) |
returns a binary join tree corresponding to clique graph JT
computes the binary join tree
This method creates and returns a new binary join tree compatible with that passed in argument (JT) and optimized for inference. As such, this requires knowing the join tree to be converted (of course), but also which roots will be used by the collect/diffusion inference engine and the domain size of the variables contained in the cliques of JT (to optimize the combination of the tensors contained in the cliques.
| InvalidNode | exception is thrown if some roots do not belong to JT or if several roots belong to the same connected component. |
Definition at line 259 of file binaryJoinTreeConverterDefault.cpp.
References _convertConnectedComponent_(), _markConnectedComponent_(), _roots_, GUM_ERROR, gum::NodeGraphPart::nodesPropertyFromVal(), and gum::NodeGraphPart::sizeNodes().
|
private |
forbid copy operator
References BinaryJoinTreeConverterDefault().
| const NodeSet & gum::BinaryJoinTreeConverterDefault::roots | ( | ) | const |
returns all the roots considered for all the connected components
Definition at line 117 of file binaryJoinTreeConverterDefault.cpp.
References _roots_.
|
private |
the new roots that have been created to compute the last query
Definition at line 98 of file binaryJoinTreeConverterDefault.h.