public void testCorrectness( int i, int cluster, int clusterIndex1, int clusterIndex2, int[] shuffle, int[] mergedClusterSites, double[] lik1, double[] lik2) throws Exception { // System.out.println("testCorrectness: "); int[] tempWeights = new int[tempLikelihood.dataInput.get().getPatternCount()]; tempWeights[tempLikelihood.dataInput.get().getPatternIndex(mergedClusterSites[shuffle[i]])] = 1; tempLikelihood.setPatternWeights(tempWeights); double temp1 = Math.exp( tempLikelihood .calculateLogP( paramList.getParameter(clusterIndex1), modelList.getParameter(clusterIndex1), freqsList.getParameter(clusterIndex1), new int[] {mergedClusterSites[shuffle[i]]})[0]); double temp2 = Math.exp( tempLikelihood .calculateLogP( paramList.getParameter(clusterIndex2), modelList.getParameter(clusterIndex2), freqsList.getParameter(clusterIndex2), new int[] {mergedClusterSites[shuffle[i]]})[0]); if (temp1 != lik1[shuffle[i]] || temp2 != lik2[shuffle[i]]) { System.out.println("temp1"); System.out.println("shuffle_i: " + shuffle[i]); System.out.println("mergedClusterSites[shuffle]: " + mergedClusterSites[shuffle[i]]); System.out.println("cluster: " + cluster); System.out.println(+mergedClusterSites.length + " " + lik1.length); for (int j = 0; j < lik1.length; j++) { System.out.println("merged lik1: " + mergedClusterSites[j] + " " + lik1[j]); } for (int j = 0; j < lik2.length; j++) { System.out.println("merged lik2: " + mergedClusterSites[j] + " " + lik2[j]); } throw new RuntimeException( temp1 + " " + lik1[shuffle[i]] + " " + temp2 + " " + lik2[shuffle[i]]); } }