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

Commit db6696e

Browse files
committed
Fix copyTree for a taxa_set to work with rooted tree properly (reported by Suha Naser)
1 parent 714d6cb commit db6696e

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

tree/constrainttree.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ void ConstraintTree::initFromTree() {
103103

104104
void ConstraintTree::readConstraint(MTree &src_tree) {
105105
copyTree(&src_tree);
106+
// convert all rooted constraint tree to unrooted
107+
if (rooted) {
108+
if (verbose_mode >= VB_MED)
109+
cout << "Converting rooted constraint tree to unrooted" << endl;
110+
convertToUnrooted();
111+
}
106112
initFromTree();
107113
}
108114

tree/mtree.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ void MTree::copyTree(MTree *tree) {
142142
}
143143

144144
void MTree::copyTree(MTree *tree, string &taxa_set) {
145+
rooted = tree->rooted;
145146
if (rooted) {
146147
ASSERT(tree->rooted);
147148
taxa_set.push_back(1);

0 commit comments

Comments
 (0)