111 #include "libhmsbeagle/platform.h" 299 int partialsBufferCount,
300 int compactBufferCount,
303 int eigenBufferCount,
304 int matrixBufferCount,
306 int scaleBufferCount,
309 long preferenceFlags,
310 long requirementFlags,
350 const int* inStates);
368 const double* inPartials);
384 const double* inPartials);
402 double* outPartials);
420 const double* inEigenVectors,
421 const double* inInverseEigenVectors,
422 const double* inEigenValues);
436 int stateFrequenciesIndex,
437 const double* inStateFrequencies);
451 int categoryWeightsIndex,
452 const double* inCategoryWeights);
465 const double* inCategoryRates);
479 int categoryRatesIndex,
480 const double* inCategoryRates);
493 const double* inPatternWeights);
509 const int* inPatternPartitions);
546 const int* firstIndices,
547 const int* secondIndices,
548 const int* resultIndices,
572 const int* probabilityIndices,
573 const int* firstDerivativeIndices,
574 const int* secondDerivativeIndices,
575 const double* edgeLengths,
599 const int* eigenIndices,
600 const int* categoryRateIndices,
601 const int* probabilityIndices,
602 const int* firstDerivativeIndices,
603 const int* secondDerivativeIndices,
604 const double* edgeLengths,
624 const double* inMatrix,
661 const int* matrixIndices,
662 const double* inMatrices,
663 const double* paddedValues,
697 int cumulativeScaleIndex);
748 const int* destinationPartials,
749 int destinationPartialsCount);
763 const int* scaleIndices,
765 int cumulativeScaleIndex);
780 const int* scaleIndices,
782 int cumulativeScaleIndex,
797 const int* scaleIndices,
799 int cumulativeScaleIndex);
816 const int* scaleIndices,
818 int cumulativeScaleIndex,
831 int cumulativeScaleIndex);
844 int cumulativeScaleIndex,
858 int destScalingIndex,
859 int srcScalingIndex);
872 double* outScaleFactors);
897 const int* bufferIndices,
898 const int* categoryWeightsIndices,
899 const int* stateFrequenciesIndices,
900 const int* cumulativeScaleIndices,
902 double* outSumLogLikelihood);
931 const int* bufferIndices,
932 const int* categoryWeightsIndices,
933 const int* stateFrequenciesIndices,
934 const int* cumulativeScaleIndices,
935 const int* partitionIndices,
938 double* outSumLogLikelihoodByPartition,
939 double* outSumLogLikelihood);
969 const int* parentBufferIndices,
970 const int* childBufferIndices,
971 const int* probabilityIndices,
972 const int* firstDerivativeIndices,
973 const int* secondDerivativeIndices,
974 const int* categoryWeightsIndices,
975 const int* stateFrequenciesIndices,
976 const int* cumulativeScaleIndices,
978 double* outSumLogLikelihood,
979 double* outSumFirstDerivative,
980 double* outSumSecondDerivative);
1019 const int* parentBufferIndices,
1020 const int* childBufferIndices,
1021 const int* probabilityIndices,
1022 const int* firstDerivativeIndices,
1023 const int* secondDerivativeIndices,
1024 const int* categoryWeightsIndices,
1025 const int* stateFrequenciesIndices,
1026 const int* cumulativeScaleIndices,
1027 const int* partitionIndices,
1030 double* outSumLogLikelihoodByPartition,
1031 double* outSumLogLikelihood,
1032 double* outSumFirstDerivativeByPartition,
1033 double* outSumFirstDerivative,
1034 double* outSumSecondDerivativeByPartition,
1035 double* outSumSecondDerivative);
1049 double* outLogLikelihoods);
1063 double* outFirstDerivatives,
1064 double* outSecondDerivatives);
1073 #endif // __beagle__ BEAGLE_DLLEXPORT const char * beagleGetVersion(void)
Get version.
BEAGLE_DLLEXPORT int beagleSetCategoryRates(int instance, const double *inCategoryRates)
Set the default category rates buffer.
BEAGLE_DLLEXPORT int beagleUpdatePartialsByPartition(const int instance, const BeagleOperationByPartition *operations, int operationCount)
Calculate or queue for calculation partials using a list of partition operations. ...
char * implName
Definition: beagle.h:206
List of hardware resources.
Definition: beagle.h:226
BEAGLE_DLLEXPORT int beagleCalculateRootLogLikelihoodsByPartition(int instance, const int *bufferIndices, const int *categoryWeightsIndices, const int *stateFrequenciesIndices, const int *cumulativeScaleIndices, const int *partitionIndices, int partitionCount, int count, double *outSumLogLikelihoodByPartition, double *outSumLogLikelihood)
Calculate site log likelihoods at a root node with per partition buffers.
int child1Partials
Definition: beagle.h:674
long requiredFlags
Definition: beagle.h:220
BEAGLE_DLLEXPORT int beagleSetEigenDecomposition(int instance, int eigenIndex, const double *inEigenVectors, const double *inInverseEigenVectors, const double *inEigenValues)
Set an eigen-decomposition buffer.
int destinationPartials
Definition: beagle.h:703
Information about a specific instance.
Definition: beagle.h:202
int destinationScaleRead
Definition: beagle.h:673
char * description
Definition: beagle.h:218
BeagleOpCodes
Operation codes.
Definition: beagle.h:193
long supportFlags
Definition: beagle.h:219
int length
Definition: beagle.h:228
BEAGLE_DLLEXPORT int beagleSetPartials(int instance, int bufferIndex, const double *inPartials)
Set an instance partials buffer.
BEAGLE_DLLEXPORT int beagleCalculateEdgeLogLikelihoods(int instance, const int *parentBufferIndices, const int *childBufferIndices, const int *probabilityIndices, const int *firstDerivativeIndices, const int *secondDerivativeIndices, const int *categoryWeightsIndices, const int *stateFrequenciesIndices, const int *cumulativeScaleIndices, int count, double *outSumLogLikelihood, double *outSumFirstDerivative, double *outSumSecondDerivative)
Calculate site log likelihoods and derivatives along an edge.
BEAGLE_DLLEXPORT int beagleGetTransitionMatrix(int instance, int matrixIndex, double *outMatrix)
Get a finite-time transition probability matrix.
BEAGLE_DLLEXPORT int beagleAccumulateScaleFactorsByPartition(int instance, const int *scaleIndices, int count, int cumulativeScaleIndex, int partitionIndex)
Accumulate scale factors by partition.
BEAGLE_DLLEXPORT int beagleGetPartials(int instance, int bufferIndex, int scaleIndex, double *outPartials)
Get partials from an instance buffer.
int child2Partials
Definition: beagle.h:708
BEAGLE_DLLEXPORT int beagleSetTransitionMatrix(int instance, int matrixIndex, const double *inMatrix, double paddedValue)
Set a finite-time transition probability matrix.
int child1TransitionMatrix
Definition: beagle.h:707
char * implDescription
Definition: beagle.h:208
BEAGLE_DLLEXPORT int beagleFinalize(void)
Finalize the library.
int cumulativeScaleIndex
Definition: beagle.h:711
int child2TransitionMatrix
Definition: beagle.h:709
BEAGLE_DLLEXPORT int beagleSetCategoryRatesWithIndex(int instance, int categoryRatesIndex, const double *inCategoryRates)
Set a category rates buffer.
int child2TransitionMatrix
Definition: beagle.h:677
int child2Partials
Definition: beagle.h:676
BEAGLE_DLLEXPORT int beagleAccumulateScaleFactors(int instance, const int *scaleIndices, int count, int cumulativeScaleIndex)
Accumulate scale factors.
char * resourceName
Definition: beagle.h:204
long flags
Definition: beagle.h:209
int child1TransitionMatrix
Definition: beagle.h:675
BeagleResource * list
Definition: beagle.h:227
int partition
Definition: beagle.h:710
BEAGLE_DLLEXPORT int beagleWaitForPartials(const int instance, const int *destinationPartials, int destinationPartialsCount)
Block until all calculations that write to the specified partials have completed. ...
int destinationScaleWrite
Definition: beagle.h:704
BEAGLE_DLLEXPORT const char * beagleGetCitation(void)
Get citation.
BEAGLE_DLLEXPORT int beagleSetCategoryWeights(int instance, int categoryWeightsIndex, const double *inCategoryWeights)
Set a category weights buffer.
BEAGLE_DLLEXPORT int beagleCopyScaleFactors(int instance, int destScalingIndex, int srcScalingIndex)
Copy scale factors.
int child1Partials
Definition: beagle.h:706
int resourceNumber
Definition: beagle.h:203
BEAGLE_DLLEXPORT int beagleSetPatternPartitions(int instance, int partitionCount, const int *inPatternPartitions)
Set pattern partition assignments.
BEAGLE_DLLEXPORT int beagleCalculateRootLogLikelihoods(int instance, const int *bufferIndices, const int *categoryWeightsIndices, const int *stateFrequenciesIndices, const int *cumulativeScaleIndices, int count, double *outSumLogLikelihood)
Calculate site log likelihoods at a root node.
BEAGLE_DLLEXPORT int beagleRemoveScaleFactorsByPartition(int instance, const int *scaleIndices, int count, int cumulativeScaleIndex, int partitionIndex)
Remove scale factors by partition.
BEAGLE_DLLEXPORT int beagleUpdateTransitionMatrices(int instance, int eigenIndex, const int *probabilityIndices, const int *firstDerivativeIndices, const int *secondDerivativeIndices, const double *edgeLengths, int count)
Calculate a list of transition probability matrices.
BEAGLE_DLLEXPORT int beagleGetSiteLogLikelihoods(int instance, double *outLogLikelihoods)
Get site log likelihoods for last beagleCalculateRootLogLikelihoods or beagleCalculateEdgeLogLikeliho...
BEAGLE_DLLEXPORT int beagleUpdatePartials(const int instance, const BeagleOperation *operations, int operationCount, int cumulativeScaleIndex)
Calculate or queue for calculation partials using a list of operations.
BEAGLE_DLLEXPORT int beagleConvolveTransitionMatrices(int instance, const int *firstIndices, const int *secondIndices, const int *resultIndices, int matrixCount)
Set partitions by pattern weight.
BEAGLE_DLLEXPORT int beagleSetTipPartials(int instance, int tipIndex, const double *inPartials)
Set an instance partials buffer for tip node.
int destinationPartials
Definition: beagle.h:671
BEAGLE_DLLEXPORT int beagleFinalizeInstance(int instance)
Finalize this instance.
BEAGLE_DLLEXPORT int beagleSetPatternWeights(int instance, const double *inPatternWeights)
Set pattern weights.
BEAGLE_DLLEXPORT int beagleSetStateFrequencies(int instance, int stateFrequenciesIndex, const double *inStateFrequencies)
Set a state frequency buffer.
A list of integer indices which specify a partial likelihoods operation for a partitioned analysis...
Definition: beagle.h:702
BEAGLE_DLLEXPORT int beagleCreateInstance(int tipCount, int partialsBufferCount, int compactBufferCount, int stateCount, int patternCount, int eigenBufferCount, int matrixBufferCount, int categoryCount, int scaleBufferCount, int *resourceList, int resourceCount, long preferenceFlags, long requirementFlags, BeagleInstanceDetails *returnInfo)
Create a single instance.
Description of a hardware resource.
Definition: beagle.h:216
BEAGLE_DLLEXPORT int beagleResetScaleFactorsByPartition(int instance, int cumulativeScaleIndex, int partitionIndex)
Reset scalefactors by partition.
BEAGLE_DLLEXPORT BeagleResourceList * beagleGetResourceList(void)
Get list of hardware resources.
BEAGLE_DLLEXPORT int beagleCalculateEdgeLogLikelihoodsByPartition(int instance, const int *parentBufferIndices, const int *childBufferIndices, const int *probabilityIndices, const int *firstDerivativeIndices, const int *secondDerivativeIndices, const int *categoryWeightsIndices, const int *stateFrequenciesIndices, const int *cumulativeScaleIndices, const int *partitionIndices, int partitionCount, int count, double *outSumLogLikelihoodByPartition, double *outSumLogLikelihood, double *outSumFirstDerivativeByPartition, double *outSumFirstDerivative, double *outSumSecondDerivativeByPartition, double *outSumSecondDerivative)
Calculate multiple site log likelihoods and derivatives along an edge with per partition buffers...
BeagleFlags
Hardware and implementation capability flags.
Definition: beagle.h:142
int destinationScaleRead
Definition: beagle.h:705
BEAGLE_DLLEXPORT int beagleSetTipStates(int instance, int tipIndex, const int *inStates)
Set the compact state representation for tip node.
BEAGLE_DLLEXPORT int beagleGetScaleFactors(int instance, int srcScalingIndex, double *outScaleFactors)
Get scale factors.
BEAGLE_DLLEXPORT int beagleGetSiteDerivatives(int instance, double *outFirstDerivatives, double *outSecondDerivatives)
Get site derivatives for last beagleCalculateEdgeLogLikelihoods call.
BEAGLE_DLLEXPORT int beagleRemoveScaleFactors(int instance, const int *scaleIndices, int count, int cumulativeScaleIndex)
Remove scale factors.
int destinationScaleWrite
Definition: beagle.h:672
char * name
Definition: beagle.h:217
A list of integer indices which specify a partial likelihoods operation.
Definition: beagle.h:670
BEAGLE_DLLEXPORT int beagleResetScaleFactors(int instance, int cumulativeScaleIndex)
Reset scalefactors.
BeagleReturnCodes
Error return codes.
Definition: beagle.h:120
BEAGLE_DLLEXPORT int beagleSetTransitionMatrices(int instance, const int *matrixIndices, const double *inMatrices, const double *paddedValues, int count)
Set multiple transition matrices.
BEAGLE_DLLEXPORT int beagleUpdateTransitionMatricesWithMultipleModels(int instance, const int *eigenIndices, const int *categoryRateIndices, const int *probabilityIndices, const int *firstDerivativeIndices, const int *secondDerivativeIndices, const double *edgeLengths, int count)
Calculate a list of transition probability matrices with multiple models.