30 template<
class BAYESTREE,
class GRAPH,
class ETREE_NODE>
50 const std::shared_ptr<ETREE_NODE>& node,
57 std::make_shared<Node>(node->key, node->factors);
64 const std::shared_ptr<ETREE_NODE>& ETreeNode,
80 symbolicFactors.
push_back(ETreeNode->factors);
85 keyAsOrdering.push_back(ETreeNode->key);
86 const auto [myConditional, mySeparatorFactor] =
96 node->problemSize_ = (
int) (myConditional->size() * symbolicFactors.
size());
100 const size_t myNrParents = myConditional->nrParents();
101 const size_t nrChildren = node->nrChildren();
102 assert(childConditionals.size() == nrChildren);
105 std::vector<size_t> nrFrontals = node->nrFrontalsOfChildren();
106 std::vector<bool> merge(nrChildren,
false);
107 size_t myNrFrontals = 1;
108 for (
size_t i = 0;
i<nrChildren;
i++){
110 if (myNrParents + myNrFrontals == childConditionals[
i]->nrParents()) {
112 myNrFrontals += nrFrontals[
i];
118 node->mergeChildren(merge);
123 template<
class BAYESTREE,
class GRAPH>
124 template<
class ETREE_BAYESNET,
class ETREE_GRAPH>
127 gttic(JunctionTree_FromEliminationTree);
141 rootData.junctionTreeNode = std::make_shared<typename Base::Node>();
143 Data::ConstructorTraversalVisitorPre,
144 Data::ConstructorTraversalVisitorPostAlg2);
147 this->addChildrenAsRoots(rootData.junctionTreeNode);