Skip to content

Commit

Permalink
correction to #1168
Browse files Browse the repository at this point in the history
  • Loading branch information
jordandouglas committed Sep 24, 2024
1 parent e6fd752 commit edc84fe
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/beast/base/evolution/likelihood/BeagleTreeLikelihood.java
Original file line number Diff line number Diff line change
Expand Up @@ -959,11 +959,15 @@ private int traverse(Node node, int[] operatorNumber, boolean flip) {
matrixUpdateIndices[eigenIndex][updateCount] = matrixBufferHelper.getOffsetIndex(nodeNum);

if (substitutionModel.canReturnComplexDiagonalization()) {
for (int i = 0; i < this.categoryCount; i++) {

int k = 0;
for (int i = 0; i < m_siteModel.getCategoryCount(); i++) {
if (i == invariantCategory) continue;
final double jointBranchRate = m_siteModel.getRateForCategory(i, node) * branchRate;
substitutionModel.getTransitionProbabilities(node, node.getParent().getHeight(), node.getHeight(), jointBranchRate, probabilities);
//System.out.println(node.getNr() + " " + Arrays.toString(m_fProbabilities));
System.arraycopy(probabilities, 0, matrices, m_nStateCount * m_nStateCount * i, m_nStateCount * m_nStateCount);
System.arraycopy(probabilities, 0, matrices, m_nStateCount * m_nStateCount * k, m_nStateCount * m_nStateCount);
k++;
}
int matrixIndex = matrixBufferHelper.getOffsetIndex(nodeNum);
beagle.setTransitionMatrix(matrixIndex, matrices, 1);
Expand Down

0 comments on commit edc84fe

Please sign in to comment.