Skip to content

Commit e61ee88

Browse files
authored
Merge pull request #17 from thomaskf/bugfix
Urgent bug fix for the issues #15 and #16
2 parents 8f3534a + cbff391 commit e61ee88

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

main/phyloanalysis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ void reportTree(ofstream &out, Params &params, PhyloTree &tree, double tree_lh,
904904
out << "Bayesian information criterion (BIC) score: " << BIC_score << endl;
905905

906906
// mAIC report
907-
if (tree.isSuperTree() && params.partition_type != TOPO_UNLINKED) {
907+
if (tree.isSuperTree() && params.partition_type != TOPO_UNLINKED && !params.contain_nonrev) {
908908
// compute mAIC/mBIC/mAICc if it is a partition model
909909
int ntrees; //mix_df;
910910
double mix_lh;

main/phylotesting.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3295,13 +3295,13 @@ int64_t CandidateModelSet::getNextModel() {
32953295
}
32963296
}
32973297
}
3298-
}
32993298
if (next_model != current_model) {
33003299
current_model = next_model;
33013300
at(next_model).setFlag(MF_RUNNING);
3302-
return next_model;
33033301
} else
3304-
return -1;
3302+
next_model = -1;
3303+
}
3304+
return next_model;
33053305
}
33063306

33073307
CandidateModel CandidateModelSet::evaluateAll(Params &params, PhyloTree* in_tree, ModelCheckpoint &model_info,

tree/phylokernelnew.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2272,6 +2272,10 @@ void PhyloTree::computeLikelihoodDervGenericSIMD(PhyloNeighbor *dad_branch, Phyl
22722272
size_t orig_nptn = aln->size();
22732273
size_t max_orig_nptn = roundUpToMultiple(orig_nptn, VectorClass::size());
22742274
size_t nptn = max_orig_nptn + model_factory->unobserved_ptns.size();
2275+
2276+
size_t g_matrix_nptn = max_orig_nptn + max(get_safe_upper_limit(model->num_states),
2277+
get_safe_upper_limit(
2278+
model_factory->unobserved_ptns.size()));
22752279
ASCType ASC_type = model_factory->getASC();
22762280
bool ASC_Holder = (ASC_type == ASC_VARIANT_MISSING || ASC_type == ASC_INFORMATIVE_MISSING);
22772281
bool ASC_Lewis = (ASC_type == ASC_VARIANT || ASC_type == ASC_INFORMATIVE);
@@ -2464,7 +2468,7 @@ void PhyloTree::computeLikelihoodDervGenericSIMD(PhyloNeighbor *dad_branch, Phyl
24642468
}
24652469
} else {
24662470
// to access g-matrix elements to store derivatives
2467-
size_t g_index = branch_id * nptn;
2471+
size_t g_index = branch_id * g_matrix_nptn;
24682472
// normal joint branch length model
24692473
for (size_t ptn = ptn_lower; ptn < ptn_upper; ptn+=VectorClass::size()) {
24702474
VectorClass lh_ptn;

utils/tools.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5912,9 +5912,9 @@ void parseArg(int argc, char *argv[], Params &params) {
59125912
err += "\" option.";
59135913
throw err;
59145914
} else {
5915-
// if (params.user_file == NULL)
5916-
// params.user_file = argv[cnt];
5917-
// else
5915+
if (params.user_file == NULL)
5916+
params.user_file = argv[cnt];
5917+
else
59185918
params.out_file = argv[cnt];
59195919
}
59205920
}

0 commit comments

Comments
 (0)