Skip to content
Snippets Groups Projects
Commit 34a9d9de authored by Van Dung NGUYEN's avatar Van Dung NGUYEN
Browse files

depth must be move

parent b7dd4511
Branches
Tags
1 merge request!309Master
......@@ -1042,6 +1042,18 @@ bool Tree::removeZeroLeaves(double tol, bool iteration)
otherChild->parent = parent->parent;
otherChild->childOrder = parent->childOrder;
grandParent->childs[parent->childOrder] = otherChild;
// decrease all associated nodes by 1
std::vector<TreeNode*> allAssociatedNodesToChild;
getRefToAssociatedNodes(otherChild,allAssociatedNodesToChild);
for (int j=0; j< allAssociatedNodesToChild.size(); j++)
{
std::vector<int> loc;
getMaxLocationByDepth(loc);
allAssociatedNodesToChild[j]->depth--;
allAssociatedNodesToChild[j]->location=loc[allAssociatedNodesToChild[j]->depth]+1;
};
Msg::Info("child weight = %e otherChild weight = %e parent weight = %e",leaf->af->getVal(leaf->weight),otherChild->af->getVal(otherChild->weight),parent->weight);
}
else if (parent->childs.size() > 2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment