use of beast.evolution.likelihood.BeerLikelihoodCore in project bacter by tgvaughan.
the class ACGLikelihood method updateCores.
/**
* Initialize likelihood cores.
*/
private void updateCores() {
List<Region> regionList = acg.getRegions(locus);
likelihoodCores.keySet().retainAll(regionList);
for (Region region : regionList) {
if (likelihoodCores.containsKey(region))
continue;
LikelihoodCore likelihoodCore;
if (nStates == 4)
likelihoodCore = new BeerLikelihoodCore4();
else
likelihoodCore = new BeerLikelihoodCore(nStates);
likelihoodCores.put(region, likelihoodCore);
likelihoodCore.initialize(acg.getNodeCount(), patterns.get(region).elementSet().size(), siteModel.getCategoryCount(), true, useAmbiguitiesInput.get());
if (scaleFactor > 1.0)
likelihoodCore.setUseScaling(scaleFactor);
if (useAmbiguitiesInput.get())
setPartials(likelihoodCore, patterns.get(region));
else
setStates(likelihoodCore, patterns.get(region));
int intNodeCount = acg.getNodeCount() / 2;
for (int i = 0; i < intNodeCount; i++) likelihoodCore.createNodePartials(intNodeCount + 1 + i);
}
}
Aggregations