Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit

Permalink
Fix copyTree for a taxa_set to work with rooted tree properly (report…
Browse files Browse the repository at this point in the history
…ed by Suha Naser)
  • Loading branch information
bqminh committed Mar 27, 2020
1 parent 714d6cb commit db6696e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tree/constrainttree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ void ConstraintTree::initFromTree() {

void ConstraintTree::readConstraint(MTree &src_tree) {
copyTree(&src_tree);
// convert all rooted constraint tree to unrooted
if (rooted) {
if (verbose_mode >= VB_MED)
cout << "Converting rooted constraint tree to unrooted" << endl;
convertToUnrooted();
}
initFromTree();
}

Expand Down
1 change: 1 addition & 0 deletions tree/mtree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ void MTree::copyTree(MTree *tree) {
}

void MTree::copyTree(MTree *tree, string &taxa_set) {
rooted = tree->rooted;
if (rooted) {
ASSERT(tree->rooted);
taxa_set.push_back(1);
Expand Down

0 comments on commit db6696e

Please sign in to comment.