.TH "beagle.Beagle" 3 "Fri May 25 2012" "Version 1.0.0" "HMSBEAGLE" \" -*- nroff -*- .ad l .nh .SH NAME beagle.Beagle \- .SH SYNOPSIS .br .PP .PP Inherited by \fBbeagle\&.BeagleJNIImpl\fP, and \fBbeagle\&.GeneralBeagleImpl\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "void \fBfinalize\fP () throws Throwable" .br .ti -1c .RI "void \fBsetPatternWeights\fP (final double[] patternWeights)" .br .ti -1c .RI "void \fBsetTipStates\fP (int tipIndex, final int[] inStates)" .br .ti -1c .RI "void \fBgetTipStates\fP (int tipIndex, final int[] outStates)" .br .ti -1c .RI "void \fBsetTipPartials\fP (int tipIndex, final double[] inPartials)" .br .ti -1c .RI "void \fBsetPartials\fP (int bufferIndex, final double[] inPartials)" .br .ti -1c .RI "void \fBgetPartials\fP (int bufferIndex, int scaleIndex, final double[]outPartials)" .br .ti -1c .RI "void \fBsetEigenDecomposition\fP (int eigenIndex, final double[] inEigenVectors, final double[] inInverseEigenVectors, final double[] inEigenValues)" .br .ti -1c .RI "void \fBsetStateFrequencies\fP (int stateFrequenciesIndex, final double[] stateFrequencies)" .br .ti -1c .RI "void \fBsetCategoryWeights\fP (int categoryWeightsIndex, final double[] categoryWeights)" .br .ti -1c .RI "void \fBsetCategoryRates\fP (final double[] inCategoryRates)" .br .ti -1c .RI "void \fBupdateTransitionMatrices\fP (int eigenIndex, final int[] probabilityIndices, final int[] firstDerivativeIndices, final int[] secondDervativeIndices, final double[] edgeLengths, int count)" .br .ti -1c .RI "void \fBsetTransitionMatrix\fP (int matrixIndex, final double[] inMatrix, double paddedValue)" .br .ti -1c .RI "void \fBgetTransitionMatrix\fP (int matrixIndex, double[] outMatrix)" .br .ti -1c .RI "void \fBupdatePartials\fP (final int[] operations, int operationCount, int cumulativeScaleIndex)" .br .ti -1c .RI "void \fBaccumulateScaleFactors\fP (final int[] scaleIndices, final int count, final int cumulativeScaleIndex)" .br .ti -1c .RI "void \fBremoveScaleFactors\fP (final int[] scaleIndices, final int count, final int cumulativeScaleIndex)" .br .ti -1c .RI "void \fBcopyScaleFactors\fP (int destScalingIndex, int srcScalingIndex)" .br .ti -1c .RI "void \fBresetScaleFactors\fP (int cumulativeScaleIndex)" .br .ti -1c .RI "void \fBcalculateRootLogLikelihoods\fP (int[] bufferIndices, int[] categoryWeightsIndices, int[] stateFrequenciesIndices, int[] cumulativeScaleIndices, int count, double[] outSumLogLikelihood)" .br .ti -1c .RI "void \fBcalculateEdgeLogLikelihoods\fP (int[] parentBufferIndices, int[] childBufferIndices, int[] probabilityIndices, int[] firstDerivativeIndices, int[] secondDerivativeIndices, int[] categoryWeightsIndices, int[] stateFrequenciesIndices, int[] cumulativeScaleIndices, int count, double[] outSumLogLikelihood, double[] outSumFirstDerivative, double[] outSumSecondDerivative)" .br .ti -1c .RI "void \fBgetSiteLogLikelihoods\fP (double[] outLogLikelihoods)" .br .ti -1c .RI "\fBInstanceDetails\fP \fBgetDetails\fP ()" .br .in -1c .SS "Static Public Attributes" .in +1c .ti -1c .RI "static int \fBOPERATION_TUPLE_SIZE\fP = 7" .br .ti -1c .RI "static int \fBNONE\fP = -1" .br .in -1c .SH "Detailed Description" .PP \fBBeagle\fP - An interface exposing the BEAGLE likelihood evaluation library\&. .PP This interface mirrors the \fBbeagle\&.h\fP API but it for a single instance only\&. It is intended to be used by JNI wrappers of the BEAGLE library and for Java implementations for testing purposes\&. \fBBeagleFactory\fP handles the creation of specific istances\&. .PP \fBAuthor:\fP .RS 4 Andrew Rambaut .PP Marc A\&. Suchard .RE .PP \fBVersion:\fP .RS 4 $Id:$ .RE .PP .SH "Member Function Documentation" .PP .SS "void beagle\&.Beagle\&.accumulateScaleFactors (final int[]scaleIndices, final intcount, final intcumulativeScaleIndex)" Accumulate scale factors .PP This function adds (log) scale factors from a list of scaleBuffers to a cumulative scale buffer\&. It is used to calculate the marginal scaling at a specific node for each site\&. .PP \fBParameters:\fP .RS 4 \fIscaleIndices\fP List of scaleBuffers to add (input) .br \fIcount\fP Number of scaleBuffers in list (input) .br \fIcumulativeScaleIndex\fP Index number of scaleBuffer to accumulate factors into (input) .RE .PP .PP Implemented in \fBbeagle\&.BeagleJNIImpl\fP\&. .SS "void beagle\&.Beagle\&.calculateEdgeLogLikelihoods (int[]parentBufferIndices, int[]childBufferIndices, int[]probabilityIndices, int[]firstDerivativeIndices, int[]secondDerivativeIndices, int[]categoryWeightsIndices, int[]stateFrequenciesIndices, int[]cumulativeScaleIndices, intcount, double[]outSumLogLikelihood, double[]outSumFirstDerivative, double[]outSumSecondDerivative)" Calculate site log likelihoods and derivatives along an edge .PP This function integrates at list of partials at a parent and child node with respect to a set of partials-weights and state frequencies to return the log likelihoods and first and second derivatives for each site .PP \fBParameters:\fP .RS 4 \fIparentBufferIndices\fP List of indices of parent partialsBuffers (input) .br \fIchildBufferIndices\fP List of indices of child partialsBuffers (input) .br \fIprobabilityIndices\fP List indices of transition probability matrices for this edge (input) .br \fIfirstDerivativeIndices\fP List indices of first derivative matrices (input) .br \fIsecondDerivativeIndices\fP List indices of second derivative matrices (input) .br \fIcategoryWeightsIndices\fP List of indices of category weights to apply to each partialsBuffer (input) .br \fIstateFrequenciesIndices\fP List of indices of state frequencies for each partialsBuffer (input) There should be one set for each of parentBufferIndices .br \fIcumulativeScaleIndices\fP List of scalingFactors indices to accumulate over (input)\&. There There should be one set for each of parentBufferIndices .br \fIcount\fP Number of partialsBuffers (input) .br \fIoutSumLogLikelihood\fP Pointer to destination for resulting sum of log likelihoods (output) .br \fIoutSumFirstDerivative\fP Pointer to destination for resulting sum of first derivatives (output) .br \fIoutSumSecondDerivative\fP Pointer to destination for resulting sum of second derivatives (output) .RE .PP .SS "void beagle\&.Beagle\&.calculateRootLogLikelihoods (int[]bufferIndices, int[]categoryWeightsIndices, int[]stateFrequenciesIndices, int[]cumulativeScaleIndices, intcount, double[]outSumLogLikelihood)" Calculate site log likelihoods at a root node .PP This function integrates a list of partials at a node with respect to a set of partials-weights and state frequencies to return the log likelihoods for each site .PP \fBParameters:\fP .RS 4 \fIbufferIndices\fP List of partialsBuffer indices to integrate (input) .br \fIcategoryWeightsIndices\fP List of indices of category weights to apply to each partialsBuffer (input) should be one categoryCount sized set for each of parentBufferIndices .br \fIstateFrequenciesIndices\fP List of indices of state frequencies for each partialsBuffer (input) should be one set for each of parentBufferIndices .br \fIcumulativeScaleIndices\fP List of scalingFactors indices to accumulate over (input)\&. There should be one set for each of parentBufferIndices .br \fIcount\fP Number of partialsBuffer to integrate (input) .br \fIoutSumLogLikelihood\fP Pointer to destination for resulting sum of log likelihoods (output) .RE .PP .SS "void beagle\&.Beagle\&.copyScaleFactors (intdestScalingIndex, intsrcScalingIndex)" Copy scale factors .PP This function copies scale factors from one buffer to another\&. .PP \fBParameters:\fP .RS 4 \fIinstance\fP Instance number (input) .br \fIdestScalingIndex\fP Destination scaleBuffer (input) .br \fIsrcScalingIndex\fP Source scaleBuffer (input) .RE .PP .PP Implemented in \fBbeagle\&.GeneralBeagleImpl\fP, and \fBbeagle\&.BeagleJNIImpl\fP\&. .SS "void beagle\&.Beagle\&.finalize () throws Throwable" Finalize this instance .PP This function finalizes the instance by releasing allocated memory .PP Implemented in \fBbeagle\&.GeneralBeagleImpl\fP, and \fBbeagle\&.BeagleJNIImpl\fP\&. .SS "\fBInstanceDetails\fP beagle\&.Beagle\&.getDetails ()" Get a details class for this instance .PP \fBReturns:\fP .RS 4 .RE .PP .PP Implemented in \fBbeagle\&.GeneralBeagleImpl\fP, and \fBbeagle\&.BeagleJNIImpl\fP\&. .SS "void beagle\&.Beagle\&.getPartials (intbufferIndex, intscaleIndex, final double[]outPartials)" Get partials from an instance buffer .PP This function copies an array of partials from an instance buffer\&. The inPartials array should be stateCount * patternCount * categoryCount in length\&. .PP \fBParameters:\fP .RS 4 \fIbufferIndex\fP Index of destination partialsBuffer (input) .br \fIscaleIndex\fP Index of scaleBuffer to apply to partials (input) .br \fIoutPartials\fP Pointer to which to receive partialsBuffer (output) .RE .PP .PP Implemented in \fBbeagle\&.BeagleJNIImpl\fP\&. .SS "void beagle\&.Beagle\&.getSiteLogLikelihoods (double[]outLogLikelihoods)" Return the individual log likelihoods for each site pattern\&. .PP \fBParameters:\fP .RS 4 \fIoutLogLikelihoods\fP an array in which the likelihoods will be put .RE .PP .SS "void beagle\&.Beagle\&.getTipStates (inttipIndex, final int[]outStates)" Get the compressed state representation for tip node .PP This function copies a compact state representation from an instance buffer\&. Compact state representation is an array of states: 0 to stateCount - 1 (missing = stateCount)\&. The inStates array should be patternCount in length (replication across categoryCount is not required)\&. .PP \fBParameters:\fP .RS 4 \fItipIndex\fP Index of destination partialsBuffer (input) .br \fIoutStates\fP Pointer to compressed states (input) .RE .PP .PP Implemented in \fBbeagle\&.BeagleJNIImpl\fP\&. .SS "void beagle\&.Beagle\&.getTransitionMatrix (intmatrixIndex, double[]outMatrix)" Get a finite-time transition probability matrix .PP This function copies a finite-time transition matrix buffer into the array outMatrix\&. The outMatrix array should be of size stateCount * stateCount * categoryCount and will be filled with one matrix for each rate category\&. .PP \fBParameters:\fP .RS 4 \fImatrixIndex\fP Index of matrix buffer (input) .br \fIoutMatrix\fP Pointer to destination transition probability matrix (output) .RE .PP .SS "void beagle\&.Beagle\&.removeScaleFactors (final int[]scaleIndices, final intcount, final intcumulativeScaleIndex)" Remove scale factors .PP This function removes (log) scale factors from a cumulative scale buffer\&. The scale factors to be removed are indicated in a list of scaleBuffers\&. .PP \fBParameters:\fP .RS 4 \fIscaleIndices\fP List of scaleBuffers to remove (input) .br \fIcount\fP Number of scaleBuffers in list (input) .br \fIcumulativeScaleIndex\fP Index number of scaleBuffer containing accumulated factors (input) .RE .PP .SS "void beagle\&.Beagle\&.resetScaleFactors (intcumulativeScaleIndex)" Reset scalefactors .PP This function resets a cumulative scale buffer\&. .PP \fBParameters:\fP .RS 4 \fIcumulativeScaleIndex\fP Index number of cumulative scaleBuffer (input) .RE .PP .PP Implemented in \fBbeagle\&.GeneralBeagleImpl\fP, and \fBbeagle\&.BeagleJNIImpl\fP\&. .SS "void beagle\&.Beagle\&.setCategoryRates (final double[]inCategoryRates)" Set category rates .PP This function sets the vector of category rates for an instance\&. .PP \fBParameters:\fP .RS 4 \fIinCategoryRates\fP Array containing categoryCount rate scalers (input) .RE .PP .SS "void beagle\&.Beagle\&.setCategoryWeights (intcategoryWeightsIndex, final double[]categoryWeights)" Set a set of category weights\&. These will probably correspond to an eigen-system\&. .PP \fBParameters:\fP .RS 4 \fIcategoryWeightsIndex\fP the index of the buffer .br \fIcategoryWeights\fP the array of weights .RE .PP .PP Implemented in \fBbeagle\&.BeagleJNIImpl\fP\&. .SS "void beagle\&.Beagle\&.setEigenDecomposition (inteigenIndex, final double[]inEigenVectors, final double[]inInverseEigenVectors, final double[]inEigenValues)" Set an eigen-decomposition buffer .PP This function copies an eigen-decomposition into a instance buffer\&. .PP \fBParameters:\fP .RS 4 \fIeigenIndex\fP Index of eigen-decomposition buffer (input) .br \fIinEigenVectors\fP Flattened matrix (stateCount x stateCount) of eigen-vectors (input) .br \fIinInverseEigenVectors\fP Flattened matrix (stateCount x stateCount) of inverse-eigen-vectors (input) .br \fIinEigenValues\fP Vector of eigenvalues .RE .PP .PP Implemented in \fBbeagle\&.BeagleJNIImpl\fP\&. .SS "void beagle\&.Beagle\&.setPartials (intbufferIndex, final double[]inPartials)" Set an instance partials buffer .PP This function copies an array of partials into an instance buffer\&. The inPartials array should be stateCount * patternCount * categoryCount in length\&. .PP \fBParameters:\fP .RS 4 \fIbufferIndex\fP Index of destination partialsBuffer (input) .br \fIinPartials\fP Pointer to partials values to set (input) .RE .PP .PP Implemented in \fBbeagle\&.BeagleJNIImpl\fP\&. .SS "void beagle\&.Beagle\&.setPatternWeights (final double[]patternWeights)" Set the weights for each pattern .PP \fBParameters:\fP .RS 4 \fIpatternWeights\fP Array containing patternCount weights .RE .PP .PP Implemented in \fBbeagle\&.GeneralBeagleImpl\fP, and \fBbeagle\&.BeagleJNIImpl\fP\&. .SS "void beagle\&.Beagle\&.setStateFrequencies (intstateFrequenciesIndex, final double[]stateFrequencies)" Set a set of state frequences\&. These will probably correspond to an eigen-system\&. .PP \fBParameters:\fP .RS 4 \fIstateFrequenciesIndex\fP the index of the frequency buffer .br \fIstateFrequencies\fP the array of frequences (stateCount) .RE .PP .PP Implemented in \fBbeagle\&.BeagleJNIImpl\fP\&. .SS "void beagle\&.Beagle\&.setTipPartials (inttipIndex, final double[]inPartials)" Set an instance partials buffer .PP This function copies an array of partials into an instance buffer\&. The inPartials array should be stateCount * patternCount in length\&. For most applications this will be used to set the partial likelihoods for the observed states\&. Internally, the partials will be copied categoryCount times\&. .PP \fBParameters:\fP .RS 4 \fItipIndex\fP Index of destination partialsBuffer (input) .br \fIinPartials\fP Pointer to partials values to set (input) .RE .PP .PP Implemented in \fBbeagle\&.BeagleJNIImpl\fP\&. .SS "void beagle\&.Beagle\&.setTipStates (inttipIndex, final int[]inStates)" Set the compressed state representation for tip node .PP This function copies a compact state representation into an instance buffer\&. Compact state representation is an array of states: 0 to stateCount - 1 (missing = stateCount)\&. The inStates array should be patternCount in length (replication across categoryCount is not required)\&. .PP \fBParameters:\fP .RS 4 \fItipIndex\fP Index of destination partialsBuffer (input) .br \fIinStates\fP Pointer to compressed states (input) .RE .PP .PP Implemented in \fBbeagle\&.BeagleJNIImpl\fP\&. .SS "void beagle\&.Beagle\&.setTransitionMatrix (intmatrixIndex, final double[]inMatrix, doublepaddedValue)" This function copies a finite-time transition probability matrix into a matrix buffer\&. This function is used when the application wishes to explicitly set the transition probability matrix rather than using the setEigenDecomposition and updateTransitionMatrices functions\&. The inMatrix array should be of size stateCount * stateCount * categoryCount and will contain one matrix for each rate category\&. .PP This function copies a finite-time transition probability matrix into a matrix buffer\&. .PP \fBParameters:\fP .RS 4 \fImatrixIndex\fP Index of matrix buffer (input) .br \fIinMatrix\fP Pointer to source transition probability matrix (input) .br \fIpaddedValue\fP Value to be used for padding for ambiguous states (e\&.g\&. 1 for probability matrices, 0 for derivative matrices) (input) .RE .PP \fBParameters:\fP .RS 4 \fImatrixIndex\fP Index of matrix buffer (input) .br \fIinMatrix\fP Pointer to source transition probability matrix (input) .RE .PP .PP Implemented in \fBbeagle\&.BeagleJNIImpl\fP\&. .SS "void beagle\&.Beagle\&.updatePartials (final int[]operations, intoperationCount, intcumulativeScaleIndex)" Calculate or queue for calculation partials using a list of operations .PP This function either calculates or queues for calculation a list partials\&. Implementations supporting SYNCH may queue these calculations while other implementations perform these operations immediately\&. Implementations supporting GPU may perform all operations in the list simultaneously\&. .PP Operations list is a list of 7-tuple integer indices, with one 7-tuple per operation\&. Format of 7-tuple operation: {destinationPartials, destinationScaleWrite, destinationScaleRead, child1Partials, child1TransitionMatrix, child2Partials, child2TransitionMatrix} .PP \fBParameters:\fP .RS 4 \fIoperations\fP List of 7-tuples specifying operations (input) .br \fIoperationCount\fP Number of operations (input) .br \fIcumulativeScaleIndex\fP Index number of scaleBuffer to store accumulated factors (input) .RE .PP .SS "void beagle\&.Beagle\&.updateTransitionMatrices (inteigenIndex, final int[]probabilityIndices, final int[]firstDerivativeIndices, final int[]secondDervativeIndices, final double[]edgeLengths, intcount)" Calculate a list of transition probability matrices .PP This function calculates a list of transition probabilities matrices and their first and second derivatives (if requested)\&. .PP \fBParameters:\fP .RS 4 \fIeigenIndex\fP Index of eigen-decomposition buffer (input) .br \fIprobabilityIndices\fP List of indices of transition probability matrices to update (input) .br \fIfirstDerivativeIndices\fP List of indices of first derivative matrices to update (input, NULL implies no calculation) .br \fIsecondDervativeIndices\fP List of indices of second derivative matrices to update (input, NULL implies no calculation) .br \fIedgeLengths\fP List of edge lengths with which to perform calculations (input) .br \fIcount\fP Length of lists .RE .PP .PP Implemented in \fBbeagle\&.BeagleJNIImpl\fP\&. .SH "Author" .PP Generated automatically by Doxygen for HMSBEAGLE from the source code\&.