HMSBEAGLE  1.0.0
Public Member Functions
beagle.BeagleJNIImpl Class Reference
Inheritance diagram for beagle.BeagleJNIImpl:
beagle.Beagle

List of all members.

Public Member Functions

 BeagleJNIImpl (int tipCount, int partialsBufferCount, int compactBufferCount, int stateCount, int patternCount, int eigenBufferCount, int matrixBufferCount, int categoryCount, int scaleBufferCount, final int[] resourceList, long preferenceFlags, long requirementFlags)
void finalize () throws Throwable
void setPatternWeights (final double[] patternWeights)
void setTipStates (int tipIndex, final int[] states)
void getTipStates (int tipIndex, final int[] states)
void setTipPartials (int tipIndex, final double[] partials)
void setPartials (int bufferIndex, final double[] partials)
void getPartials (int bufferIndex, int scaleIndex, final double[]outPartials)
void setEigenDecomposition (int eigenIndex, final double[] eigenVectors, final double[] inverseEigenValues, final double[] eigenValues)
void setStateFrequencies (int stateFrequenciesIndex, final double[] stateFrequencies)
void setCategoryWeights (int categoryWeightsIndex, final double[] categoryWeights)
void setCategoryRates (double[] inCategoryRates)
void setTransitionMatrix (int matrixIndex, final double[] inMatrix, double paddedValue)
void getTransitionMatrix (int matrixIndex, final double[] outMatrix)
void updateTransitionMatrices (int eigenIndex, final int[] probabilityIndices, final int[] firstDerivativeIndices, final int[] secondDervativeIndices, final double[] edgeLengths, int count)
void updatePartials (final int[] operations, final int operationCount, final int cumulativeScaleIndex)
void accumulateScaleFactors (final int[] scaleIndices, final int count, final int cumulativeScaleIndex)
void removeScaleFactors (int[] scaleIndices, int count, int cumulativeScaleIndex)
void copyScaleFactors (int destScalingIndex, int srcScalingIndex)
void resetScaleFactors (int cumulativeScaleIndex)
void calculateRootLogLikelihoods (int[] bufferIndices, final int[] categoryWeightsIndices, final int[] stateFrequenciesIndices, final int[] cumulativeScaleIndices, int count, final double[] outSumLogLikelihood)
void calculateEdgeLogLikelihoods (final int[] parentBufferIndices, final int[] childBufferIndices, final int[] probabilityIndices, final int[] firstDerivativeIndices, final int[] secondDerivativeIndices, final int[] categoryWeightsIndices, final int[] stateFrequenciesIndices, final int[] cumulativeScaleIndices, int count, final double[] outSumLogLikelihood, final double[] outSumFirstDerivative, final double[] outSumSecondDerivative)
void getSiteLogLikelihoods (final double[] outLogLikelihoods)
InstanceDetails getDetails ()

Member Function Documentation

void beagle.BeagleJNIImpl.accumulateScaleFactors ( final int[]  scaleIndices,
final int  count,
final int  cumulativeScaleIndex 
) [inline]

Accumulate scale factors

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.

Parameters:
scaleIndicesList of scaleBuffers to add (input)
countNumber of scaleBuffers in list (input)
cumulativeScaleIndexIndex number of scaleBuffer to accumulate factors into (input)

Implements beagle.Beagle.

void beagle.BeagleJNIImpl.copyScaleFactors ( int  destScalingIndex,
int  srcScalingIndex 
) [inline]

Copy scale factors

This function copies scale factors from one buffer to another.

Parameters:
instanceInstance number (input)
destScalingIndexDestination scaleBuffer (input)
srcScalingIndexSource scaleBuffer (input)

Implements beagle.Beagle.

void beagle.BeagleJNIImpl.finalize ( ) throws Throwable [inline]

Finalize this instance

This function finalizes the instance by releasing allocated memory

Implements beagle.Beagle.

Get a details class for this instance

Returns:

Implements beagle.Beagle.

void beagle.BeagleJNIImpl.getPartials ( int  bufferIndex,
int  scaleIndex,
final double[]  outPartials 
) [inline]

Get partials from an instance buffer

This function copies an array of partials from an instance buffer. The inPartials array should be stateCount * patternCount * categoryCount in length.

Parameters:
bufferIndexIndex of destination partialsBuffer (input)
scaleIndexIndex of scaleBuffer to apply to partials (input)
outPartialsPointer to which to receive partialsBuffer (output)

Implements beagle.Beagle.

void beagle.BeagleJNIImpl.getTipStates ( int  tipIndex,
final int[]  outStates 
) [inline]

Get the compressed state representation for tip node

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).

Parameters:
tipIndexIndex of destination partialsBuffer (input)
outStatesPointer to compressed states (input)

Implements beagle.Beagle.

void beagle.BeagleJNIImpl.resetScaleFactors ( int  cumulativeScaleIndex) [inline]

Reset scalefactors

This function resets a cumulative scale buffer.

Parameters:
cumulativeScaleIndexIndex number of cumulative scaleBuffer (input)

Implements beagle.Beagle.

void beagle.BeagleJNIImpl.setCategoryWeights ( int  categoryWeightsIndex,
final double[]  categoryWeights 
) [inline]

Set a set of category weights. These will probably correspond to an eigen-system.

Parameters:
categoryWeightsIndexthe index of the buffer
categoryWeightsthe array of weights

Implements beagle.Beagle.

void beagle.BeagleJNIImpl.setEigenDecomposition ( int  eigenIndex,
final double[]  inEigenVectors,
final double[]  inInverseEigenVectors,
final double[]  inEigenValues 
) [inline]

Set an eigen-decomposition buffer

This function copies an eigen-decomposition into a instance buffer.

Parameters:
eigenIndexIndex of eigen-decomposition buffer (input)
inEigenVectorsFlattened matrix (stateCount x stateCount) of eigen-vectors (input)
inInverseEigenVectorsFlattened matrix (stateCount x stateCount) of inverse-eigen-vectors (input)
inEigenValuesVector of eigenvalues

Implements beagle.Beagle.

void beagle.BeagleJNIImpl.setPartials ( int  bufferIndex,
final double[]  inPartials 
) [inline]

Set an instance partials buffer

This function copies an array of partials into an instance buffer. The inPartials array should be stateCount * patternCount * categoryCount in length.

Parameters:
bufferIndexIndex of destination partialsBuffer (input)
inPartialsPointer to partials values to set (input)

Implements beagle.Beagle.

void beagle.BeagleJNIImpl.setPatternWeights ( final double[]  patternWeights) [inline]

Set the weights for each pattern

Parameters:
patternWeightsArray containing patternCount weights

Implements beagle.Beagle.

void beagle.BeagleJNIImpl.setStateFrequencies ( int  stateFrequenciesIndex,
final double[]  stateFrequencies 
) [inline]

Set a set of state frequences. These will probably correspond to an eigen-system.

Parameters:
stateFrequenciesIndexthe index of the frequency buffer
stateFrequenciesthe array of frequences (stateCount)

Implements beagle.Beagle.

void beagle.BeagleJNIImpl.setTipPartials ( int  tipIndex,
final double[]  inPartials 
) [inline]

Set an instance partials buffer

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.

Parameters:
tipIndexIndex of destination partialsBuffer (input)
inPartialsPointer to partials values to set (input)

Implements beagle.Beagle.

void beagle.BeagleJNIImpl.setTipStates ( int  tipIndex,
final int[]  inStates 
) [inline]

Set the compressed state representation for tip node

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).

Parameters:
tipIndexIndex of destination partialsBuffer (input)
inStatesPointer to compressed states (input)

Implements beagle.Beagle.

void beagle.BeagleJNIImpl.setTransitionMatrix ( int  matrixIndex,
final double[]  inMatrix,
double  paddedValue 
) [inline]

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.

This function copies a finite-time transition probability matrix into a matrix buffer.

Parameters:
matrixIndexIndex of matrix buffer (input)
inMatrixPointer to source transition probability matrix (input)
paddedValueValue to be used for padding for ambiguous states (e.g. 1 for probability matrices, 0 for derivative matrices) (input)

Implements beagle.Beagle.

void beagle.BeagleJNIImpl.updateTransitionMatrices ( int  eigenIndex,
final int[]  probabilityIndices,
final int[]  firstDerivativeIndices,
final int[]  secondDervativeIndices,
final double[]  edgeLengths,
int  count 
) [inline]

Calculate a list of transition probability matrices

This function calculates a list of transition probabilities matrices and their first and second derivatives (if requested).

Parameters:
eigenIndexIndex of eigen-decomposition buffer (input)
probabilityIndicesList of indices of transition probability matrices to update (input)
firstDerivativeIndicesList of indices of first derivative matrices to update (input, NULL implies no calculation)
secondDervativeIndicesList of indices of second derivative matrices to update (input, NULL implies no calculation)
edgeLengthsList of edge lengths with which to perform calculations (input)
countLength of lists

Implements beagle.Beagle.


The documentation for this class was generated from the following file: