Skip to content

Commit cf8e813

Browse files
committed
fix a bug about partitionfinder greedy algorithm
1 parent 56bb984 commit cf8e813

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

main/phylotesting.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4061,6 +4061,8 @@ void PartitionFinder::retreiveAnsFrChkpt(vector<pair<int,double> >& jobs, int jo
40614061
//cur_pair.distance = closest_pairs[pair].distance;
40624062
//cur_pair.score_bic = computeInformationScore(lhnew, dfnew, ssize, MTC_BIC);
40634063
sorted_pairs.insertPair(cur_pair);
4064+
} else if (params->partition_merge == MERGE_GREEDY) {
4065+
better_pairs.insertPair(cur_pair);
40644066
}
40654067

40664068
to_delete.push_back(1);
@@ -4348,7 +4350,7 @@ ModelPairSet PartitionFinder::getBetterPairsmAIC() {
43484350
}
43494351
}
43504352

4351-
if (params->partition_merge == MERGE_GREEDY && better_pairs.size() > 0) {
4353+
if (params->partition_merge == MERGE_GREEDY && cur_better_pairs.size() > 0) {
43524354
auto it = cur_better_pairs.begin();
43534355
int cur_df = dfsum - dfvec[it->second.part1] - dfvec[it->second.part2] + it->second.df;
43544356
cout << "Merging " << it->second.set_name << " with mAIC score: " << greedy_score_maic

0 commit comments

Comments
 (0)