Package pal.treesearch
Class FreeBranch
java.lang.Object
pal.treesearch.FreeBranch
- All Implemented Interfaces:
GeneralOptimisable,RootAccess
-
Constructor Summary
ConstructorsConstructorDescriptionFreeBranch(Node n, FreeNode parent, GeneralConstructionTool tool, GeneralConstraintGroupManager.Store store) Continuing recurison constructor for a given treeFreeBranch(Node n, GeneralConstructionTool tool, GeneralConstraintGroupManager.Store store) The starting constructor for building from a given treeFreeBranch(FreeNode left, FreeNode right, double branchLength, GeneralConstructionTool tool) A generic constructor given two already defined left and right children -
Method Summary
Modifier and TypeMethodDescriptionattachTo(FreeBranch attachmentPoint, FreeBranch[] store) buildPALNodeBase(FreeNode caller) buildPALNodeES(FreeNode caller) doubledoublecalculateSiteDetails(UnconstrainedLikelihoodModel.External calculator, GeneralConstructionTool tool) booleandoNNI(boolean leftSwapLeft, boolean rightSwapLeft) Does not reconstruct patternsfinal voidvoidgetAllComponents(ArrayList store, Class componentType) voidgetAllComponents(ArrayList store, Class componentType, FreeNode caller) final doublefinal PatternInfovoidgetCenterPatternInfo(GeneralConstructionTool tool, PatternInfo store) getExtendedConditionalProbabilities(FreeNode caller, UnconstrainedLikelihoodModel.External externalCalculator, ConditionalProbabilityStore extendedStore, GeneralConstructionTool tool) final FreeNodegetLeft()final PatternInfofinal intfinal PatternInfogetPatternInfo(GeneralConstructionTool tool, FreeNode caller) final FreeNodegetRight()final PatternInfobooleanhasConnection(FreeBranch c, FreeNode caller) final voidmark()Mark this node, or in other words store information on left and right nodes and branch length for later retreival (via undoToMark())doubleoptimise(int optimisationType, UnivariateMinimum minimiser, GeneralConstructionTool tool, int fracDigits) voidsetAnnotation(Object annotation) final voidsetBranchLength(double x) voidDoes nothing to fix up tree structurevoidvoidtestLikelihood(FreeNode caller, GeneralConstructionTool tool) voidtoString()final void
-
Constructor Details
-
FreeBranch
The starting constructor for building from a given tree- Parameters:
n- The normal PAL node structure to base this tree ontool- to aid in construction
-
FreeBranch
public FreeBranch(Node n, FreeNode parent, GeneralConstructionTool tool, GeneralConstraintGroupManager.Store store) Continuing recurison constructor for a given tree- Parameters:
n- The PAL node structure to base sub tree onparent- The parent node (sub tree in other direction)tool- to aid in construction
-
FreeBranch
A generic constructor given two already defined left and right children- Parameters:
left- The left noderight- The right nodebranchLength- The length of connectiontool- to aid in construction
-
-
Method Details
-
setAnnotation
-
getLeft
- Returns:
- The "right" node of this connection.
-
getRight
- Returns:
- The "left" node of this connection.
-
mark
public final void mark()Mark this node, or in other words store information on left and right nodes and branch length for later retreival (via undoToMark()) -
getLeftPatternInfo
- Returns:
- The pattern info object for the left node leading to this connection
-
getRightPatternInfo
- Returns:
- The pattern info object for the right node leading to this connection
-
getPatternInfo
-
getCenterPatternInfo
- Returns:
- The pattern info across this connection (for use if this connection is the "root" of the likelihood calculation)
-
undoToMark
public final void undoToMark() -
toString
-
hasConnection
-
getLeftLeftBranch
- Returns:
- the "left" connection of the left node
-
getLeftRightBranch
- Returns:
- the "right" connection of the left node
-
getRightLeftBranch
- Returns:
- the "left" connection of the right node
-
getRightRightBranch
- Returns:
- the "right" connection of the left node
-
attachTo
- Returns:
- connection that by attaching to we would undo this operation, null if operation no successful
-
buildPALNodeBase
- Specified by:
buildPALNodeBasein interfaceRootAccess
-
buildPALNodeES
- Specified by:
buildPALNodeESin interfaceRootAccess
-
buildPALNodeBase
-
buildPALNodeES
-
setNodes
Does nothing to fix up tree structure -
swapNode
-
getLeftFlatConditionalProbabilities
public final ConditionalProbabilityStore getLeftFlatConditionalProbabilities(GeneralConstructionTool tool) -
getRightFlatConditionalProbabilities
public final ConditionalProbabilityStore getRightFlatConditionalProbabilities(GeneralConstructionTool tool) -
getBranchLength
public final double getBranchLength() -
setBranchLength
public final void setBranchLength(double x) -
toString
-
testLikelihood
- Specified by:
testLikelihoodin interfaceRootAccess
-
testLikelihood
-
getExtendedConditionalProbabilities
public ConditionalProbabilityStore getExtendedConditionalProbabilities(FreeNode caller, GeneralConstructionTool tool) -
getExtendedConditionalProbabilities
public ConditionalProbabilityStore getExtendedConditionalProbabilities(FreeNode caller, UnconstrainedLikelihoodModel.External externalCalculator, ConditionalProbabilityStore extendedStore, GeneralConstructionTool tool) -
getNumberOfOptimisationTypes
public final int getNumberOfOptimisationTypes()- Specified by:
getNumberOfOptimisationTypesin interfaceGeneralOptimisable
-
optimise
public double optimise(int optimisationType, UnivariateMinimum minimiser, GeneralConstructionTool tool, int fracDigits) - Specified by:
optimisein interfaceGeneralOptimisableminimiser- The single dimensional minimisation tooltool- The construction toolfracDigits- the number of fractional digits to converge to- Returns:
- The optimised log likelihood, or >0 if not optimisation occured
-
getAllComponents
- Specified by:
getAllComponentsin interfaceRootAccess
-
getAllComponents
-
getCenterPatternInfo
-
getOther
-
doNNI
-
doNNI
public boolean doNNI(boolean leftSwapLeft, boolean rightSwapLeft) Does not reconstruct patterns -
calculateLogLikelihood
- Specified by:
calculateLogLikelihoodin interfaceRootAccess
-
calculateLogLikelihood2
-
calculateSiteDetails
public SiteDetails calculateSiteDetails(UnconstrainedLikelihoodModel.External calculator, GeneralConstructionTool tool)
-