Likelihood
Class Calculator.SiteCalculator

java.lang.Object
  extended by Likelihood.Calculator.SiteCalculator
All Implemented Interfaces:
java.util.concurrent.Callable<Likelihood.SiteLikelihood>
Enclosing class:
Calculator

public static class Calculator.SiteCalculator
extends java.lang.Object
implements java.util.concurrent.Callable<Likelihood.SiteLikelihood>

Calculates the likelihood of a single site. Implemeted like this as it allows parrallel calculation.

Version:
1.0

Constructor Summary
Calculator.SiteCalculator(Site s, Tree t, SiteConstraints con, Probabilities tp)
          Constructor mainly for backwards compitability although also still used by some of the ancestral calculations.
Calculator.SiteCalculator(Tree t, Probabilities tp, ArrayMap<java.lang.String,Likelihood.NodeLikelihood> nl)
          Standard constructor
 
Method Summary
 Likelihood.SiteLikelihood calculate()
          Calculates the likelihood
 Likelihood.SiteLikelihood call()
           
 Likelihood.SiteLikelihood getResult()
          Gets the computed result
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Calculator.SiteCalculator

public Calculator.SiteCalculator(Tree t,
                                 Probabilities tp,
                                 ArrayMap<java.lang.String,Likelihood.NodeLikelihood> nl)
Standard constructor

Parameters:
t - Tree
tp - Pre-computed datastructure containing probabilities
nl - Initalised node likelihoods based on the site and any constraints. See Site.getInitialNodeLikelihoods(Trees.Tree, Utils.ArrayMap, Constraints.SiteConstraints).

Calculator.SiteCalculator

public Calculator.SiteCalculator(Site s,
                                 Tree t,
                                 SiteConstraints con,
                                 Probabilities tp)
Constructor mainly for backwards compitability although also still used by some of the ancestral calculations. Calculates the initial node likelihoods as part of the constructor

Parameters:
s - The site
t - The tree
con - Constraints on the site
tp - Pre-computed datastructure containing probabilities
Method Detail

call

public Likelihood.SiteLikelihood call()
Specified by:
call in interface java.util.concurrent.Callable<Likelihood.SiteLikelihood>

calculate

public Likelihood.SiteLikelihood calculate()
Calculates the likelihood

Returns:
Object containing the likelihood and the results of intermediate calculations.

getResult

public Likelihood.SiteLikelihood getResult()
                                    throws Likelihood.Calculator.ResultNotComputed
Gets the computed result

Returns:
The computed result
Throws:
Likelihood.Calculator.ResultNotComputed - If the result has not been computed for any reason.