32 template<
class BAYESTREE,
class GRAPH,
class ETREE_NODE>
52 const std::shared_ptr<ETREE_NODE>& node,
59 std::make_shared<Node>(node->key, node->factors);
66 const std::shared_ptr<ETREE_NODE>& ETreeNode,
82 symbolicFactors.
push_back(ETreeNode->factors);
87 keyAsOrdering.push_back(ETreeNode->key);
88 const auto [myConditional, mySeparatorFactor] =
98 node->problemSize_ = (
int) (myConditional->size() * symbolicFactors.
size());
102 const size_t myNrParents = myConditional->nrParents();
103 const size_t nrChildren = node->nrChildren();
104 assert(childConditionals.size() == nrChildren);
107 std::vector<size_t> nrFrontals = node->nrFrontalsOfChildren();
108 std::vector<bool> merge(nrChildren,
false);
109 size_t myNrFrontals = 1;
110 for (
size_t i = 0;
i<nrChildren;
i++){
112 if (myNrParents + myNrFrontals == childConditionals[
i]->nrParents()) {
114 myNrFrontals += nrFrontals[
i];
120 node->mergeChildren(merge);
125 template<
class BAYESTREE,
class GRAPH>
126 template<
class ETREE_BAYESNET,
class ETREE_GRAPH>
129 gttic(JunctionTree_FromEliminationTree);
143 rootData.junctionTreeNode = std::make_shared<typename Base::Node>();
145 Data::ConstructorTraversalVisitorPre,
146 Data::ConstructorTraversalVisitorPostAlg2);
149 this->addChildrenAsRoots(rootData.junctionTreeNode);