From e6fd7524f063079b42cf3e8b9ff0a6d1bdb79700 Mon Sep 17 00:00:00 2001 From: jordandouglas Date: Mon, 23 Sep 2024 13:02:07 +1200 Subject: [PATCH] fix indexing error in beagle tree likellihood fixes #1168 --- src/beast/base/evolution/likelihood/BeagleTreeLikelihood.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/beast/base/evolution/likelihood/BeagleTreeLikelihood.java b/src/beast/base/evolution/likelihood/BeagleTreeLikelihood.java index f6f36889..679f94d2 100644 --- a/src/beast/base/evolution/likelihood/BeagleTreeLikelihood.java +++ b/src/beast/base/evolution/likelihood/BeagleTreeLikelihood.java @@ -959,7 +959,7 @@ private int traverse(Node node, int[] operatorNumber, boolean flip) { matrixUpdateIndices[eigenIndex][updateCount] = matrixBufferHelper.getOffsetIndex(nodeNum); if (substitutionModel.canReturnComplexDiagonalization()) { - for (int i = 0; i < m_siteModel.getCategoryCount(); i++) { + for (int i = 0; i < this.categoryCount; i++) { 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));