beagle.h
Go to the documentation of this file.
#ifndef __beagle__
#define __beagle__
#include "libhmsbeagle/platform.h"
enum BeagleReturnCodes {
BEAGLE_SUCCESS = 0,
BEAGLE_ERROR_GENERAL = -1,
BEAGLE_ERROR_OUT_OF_MEMORY = -2,
BEAGLE_ERROR_UNIDENTIFIED_EXCEPTION = -3,
BEAGLE_ERROR_UNINITIALIZED_INSTANCE = -4,
BEAGLE_ERROR_OUT_OF_RANGE = -5,
BEAGLE_ERROR_NO_RESOURCE = -6,
BEAGLE_ERROR_NO_IMPLEMENTATION = -7,
BEAGLE_ERROR_FLOATING_POINT = -8
};
enum BeagleFlags {
BEAGLE_FLAG_PRECISION_SINGLE = 1 << 0,
BEAGLE_FLAG_PRECISION_DOUBLE = 1 << 1,
BEAGLE_FLAG_COMPUTATION_SYNCH = 1 << 2,
BEAGLE_FLAG_COMPUTATION_ASYNCH = 1 << 3,
BEAGLE_FLAG_EIGEN_REAL = 1 << 4,
BEAGLE_FLAG_EIGEN_COMPLEX = 1 << 5,
BEAGLE_FLAG_SCALING_MANUAL = 1 << 6,
BEAGLE_FLAG_SCALING_AUTO = 1 << 7,
BEAGLE_FLAG_SCALING_ALWAYS = 1 << 8,
BEAGLE_FLAG_SCALING_DYNAMIC = 1 << 25,
BEAGLE_FLAG_SCALERS_RAW = 1 << 9,
BEAGLE_FLAG_SCALERS_LOG = 1 << 10,
BEAGLE_FLAG_INVEVEC_STANDARD = 1 << 20,
BEAGLE_FLAG_INVEVEC_TRANSPOSED = 1 << 21,
BEAGLE_FLAG_VECTOR_SSE = 1 << 11,
BEAGLE_FLAG_VECTOR_AVX = 1 << 24,
BEAGLE_FLAG_VECTOR_NONE = 1 << 12,
BEAGLE_FLAG_THREADING_CPP = 1 << 30,
BEAGLE_FLAG_THREADING_OPENMP = 1 << 13,
BEAGLE_FLAG_THREADING_NONE = 1 << 14,
BEAGLE_FLAG_PROCESSOR_CPU = 1 << 15,
BEAGLE_FLAG_PROCESSOR_GPU = 1 << 16,
BEAGLE_FLAG_PROCESSOR_FPGA = 1 << 17,
BEAGLE_FLAG_PROCESSOR_CELL = 1 << 18,
BEAGLE_FLAG_PROCESSOR_PHI = 1 << 19,
BEAGLE_FLAG_PROCESSOR_OTHER = 1 << 26,
BEAGLE_FLAG_FRAMEWORK_CUDA = 1 << 22,
BEAGLE_FLAG_FRAMEWORK_OPENCL = 1 << 23,
BEAGLE_FLAG_FRAMEWORK_CPU = 1 << 27,
BEAGLE_FLAG_PARALLELOPS_STREAMS = 1 << 28,
BEAGLE_FLAG_PARALLELOPS_GRID = 1 << 29
};
enum BeagleBenchmarkFlags {
BEAGLE_BENCHFLAG_SCALING_NONE = 1 << 0,
BEAGLE_BENCHFLAG_SCALING_ALWAYS = 1 << 1,
BEAGLE_BENCHFLAG_SCALING_DYNAMIC = 1 << 2,
};
enum BeagleOpCodes {
BEAGLE_OP_COUNT = 7,
BEAGLE_PARTITION_OP_COUNT = 9,
BEAGLE_OP_NONE = -1
};
typedef struct {
int resourceNumber;
char* resourceName;
char* implName;
char* implDescription;
long flags;
} BeagleInstanceDetails;
typedef struct {
char* name;
char* description;
long supportFlags;
long requiredFlags;
} BeagleResource;
typedef struct {
BeagleResource* list;
int length;
} BeagleResourceList;
typedef struct {
int number;
char* name;
char* description;
long supportFlags;
long requiredFlags;
int returnCode;
char* implName;
long benchedFlags;
double benchmarkResult;
double performanceRatio;
} BeagleBenchmarkedResource;
typedef struct {
BeagleBenchmarkedResource* list;
int length;
} BeagleBenchmarkedResourceList;
/* using C calling conventions so that C programs can successfully link the beagle library
* (brace is closed at the end of this file)
*/
#ifdef __cplusplus
extern "C" {
#endif
BEAGLE_DLLEXPORT const char* beagleGetVersion(void);
BEAGLE_DLLEXPORT const char* beagleGetCitation(void);
BEAGLE_DLLEXPORT BeagleResourceList* beagleGetResourceList(void);
BEAGLE_DLLEXPORT BeagleBenchmarkedResourceList* beagleGetBenchmarkedResourceList(int tipCount,
int compactBufferCount,
int stateCount,
int patternCount,
int categoryCount,
int* resourceList,
int resourceCount,
long preferenceFlags,
long requirementFlags,
int eigenModelCount,
int partitionCount,
int calculateDerivatives,
long benchmarkFlags);
// TODO: if setting your own matrices, might not need eigen buffers allocated, but still need
// category weight and state frequency buffers
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);
BEAGLE_DLLEXPORT int beagleFinalizeInstance(int instance);
BEAGLE_DLLEXPORT int beagleFinalize(void);
BEAGLE_DLLEXPORT int beagleSetCPUThreadCount(int instance,
int threadCount);
BEAGLE_DLLEXPORT int beagleSetTipStates(int instance,
int tipIndex,
const int* inStates);
BEAGLE_DLLEXPORT int beagleSetTipPartials(int instance,
int tipIndex,
const double* inPartials);
BEAGLE_DLLEXPORT int beagleSetPartials(int instance,
int bufferIndex,
const double* inPartials);
BEAGLE_DLLEXPORT int beagleGetPartials(int instance,
int bufferIndex,
int scaleIndex,
double* outPartials);
BEAGLE_DLLEXPORT int beagleSetEigenDecomposition(int instance,
int eigenIndex,
const double* inEigenVectors,
const double* inInverseEigenVectors,
const double* inEigenValues);
BEAGLE_DLLEXPORT int beagleSetStateFrequencies(int instance,
int stateFrequenciesIndex,
const double* inStateFrequencies);
BEAGLE_DLLEXPORT int beagleSetCategoryWeights(int instance,
int categoryWeightsIndex,
const double* inCategoryWeights);
BEAGLE_DLLEXPORT int beagleSetCategoryRates(int instance,
const double* inCategoryRates);
BEAGLE_DLLEXPORT int beagleSetCategoryRatesWithIndex(int instance,
int categoryRatesIndex,
const double* inCategoryRates);
BEAGLE_DLLEXPORT int beagleSetPatternWeights(int instance,
const double* inPatternWeights);
BEAGLE_DLLEXPORT int beagleSetPatternPartitions(int instance,
int partitionCount,
const int* inPatternPartitions);
// BEAGLE_DLLEXPORT int beagleSetPartitionsByPatternWeights(int instance,
// const int** inPartitionPatternWeights,
// int partitionCount);
//---TODO: Epoch model---//
BEAGLE_DLLEXPORT int beagleConvolveTransitionMatrices(int instance,
const int* firstIndices,
const int* secondIndices,
const int* resultIndices,
int matrixCount);
BEAGLE_DLLEXPORT int beagleUpdateTransitionMatrices(int instance,
int eigenIndex,
const int* probabilityIndices,
const int* firstDerivativeIndices,
const int* secondDerivativeIndices,
const double* edgeLengths,
int count);
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);
BEAGLE_DLLEXPORT int beagleSetTransitionMatrix(int instance,
int matrixIndex,
const double* inMatrix,
double paddedValue);
BEAGLE_DLLEXPORT int beagleGetTransitionMatrix(int instance,
int matrixIndex,
double* outMatrix);
BEAGLE_DLLEXPORT int beagleSetTransitionMatrices(int instance,
const int* matrixIndices,
const double* inMatrices,
const double* paddedValues,
int count);
typedef struct {
int destinationPartials;
int destinationScaleWrite;
int destinationScaleRead;
int child1Partials;
int child1TransitionMatrix;
int child2Partials;
int child2TransitionMatrix;
} BeagleOperation;
BEAGLE_DLLEXPORT int beagleUpdatePartials(const int instance,
const BeagleOperation* operations,
int operationCount,
int cumulativeScaleIndex);
typedef struct {
int destinationPartials;
int destinationScaleWrite;
int destinationScaleRead;
int child1Partials;
int child1TransitionMatrix;
int child2Partials;
int child2TransitionMatrix;
int partition;
int cumulativeScaleIndex;
} BeagleOperationByPartition;
BEAGLE_DLLEXPORT int beagleUpdatePartialsByPartition(const int instance,
const BeagleOperationByPartition* operations,
int operationCount);
BEAGLE_DLLEXPORT int beagleWaitForPartials(const int instance,
const int* destinationPartials,
int destinationPartialsCount);
BEAGLE_DLLEXPORT int beagleAccumulateScaleFactors(int instance,
const int* scaleIndices,
int count,
int cumulativeScaleIndex);
BEAGLE_DLLEXPORT int beagleAccumulateScaleFactorsByPartition(int instance,
const int* scaleIndices,
int count,
int cumulativeScaleIndex,
int partitionIndex);
BEAGLE_DLLEXPORT int beagleRemoveScaleFactors(int instance,
const int* scaleIndices,
int count,
int cumulativeScaleIndex);
BEAGLE_DLLEXPORT int beagleRemoveScaleFactorsByPartition(int instance,
const int* scaleIndices,
int count,
int cumulativeScaleIndex,
int partitionIndex);
BEAGLE_DLLEXPORT int beagleResetScaleFactors(int instance,
int cumulativeScaleIndex);
BEAGLE_DLLEXPORT int beagleResetScaleFactorsByPartition(int instance,
int cumulativeScaleIndex,
int partitionIndex);
BEAGLE_DLLEXPORT int beagleCopyScaleFactors(int instance,
int destScalingIndex,
int srcScalingIndex);
BEAGLE_DLLEXPORT int beagleGetScaleFactors(int instance,
int srcScalingIndex,
double* outScaleFactors);
// TODO: only need one state frequency index
BEAGLE_DLLEXPORT int beagleCalculateRootLogLikelihoods(int instance,
const int* bufferIndices,
const int* categoryWeightsIndices,
const int* stateFrequenciesIndices,
const int* cumulativeScaleIndices,
int count,
double* outSumLogLikelihood);
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);
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);
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);
BEAGLE_DLLEXPORT int beagleGetLogLikelihood(int instance,
double* outSumLogLikelihood);
BEAGLE_DLLEXPORT int beagleGetDerivatives(int instance,
double* outSumFirstDerivative,
double* outSumSecondDerivative);
BEAGLE_DLLEXPORT int beagleGetSiteLogLikelihoods(int instance,
double* outLogLikelihoods);
BEAGLE_DLLEXPORT int beagleGetSiteDerivatives(int instance,
double* outFirstDerivatives,
double* outSecondDerivatives);
/* using C calling conventions so that C programs can successfully link the beagle library
* (closing brace)
*/
#ifdef __cplusplus
}
#endif
#endif // __beagle__
BeagleOperationByPartition::destinationPartials
int destinationPartials
Definition: beagle.h:808
BeagleOperationByPartition::child1TransitionMatrix
int child1TransitionMatrix
Definition: beagle.h:812
BEAGLE_FLAG_PROCESSOR_FPGA
@ BEAGLE_FLAG_PROCESSOR_FPGA
Definition: beagle.h:173
BEAGLE_FLAG_EIGEN_COMPLEX
@ BEAGLE_FLAG_EIGEN_COMPLEX
Definition: beagle.h:150
beagleUpdateTransitionMatricesWithMultipleModels
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.
BeagleOperationByPartition::child2TransitionMatrix
int child2TransitionMatrix
Definition: beagle.h:814
beagleSetCategoryRates
BEAGLE_DLLEXPORT int beagleSetCategoryRates(int instance, const double *inCategoryRates)
Set the default category rates buffer.
BEAGLE_ERROR_OUT_OF_MEMORY
@ BEAGLE_ERROR_OUT_OF_MEMORY
Definition: beagle.h:123
BEAGLE_FLAG_SCALING_DYNAMIC
@ BEAGLE_FLAG_SCALING_DYNAMIC
Definition: beagle.h:155
beagleSetEigenDecomposition
BEAGLE_DLLEXPORT int beagleSetEigenDecomposition(int instance, int eigenIndex, const double *inEigenVectors, const double *inInverseEigenVectors, const double *inEigenValues)
Set an eigen-decomposition buffer.
BEAGLE_FLAG_PARALLELOPS_STREAMS
@ BEAGLE_FLAG_PARALLELOPS_STREAMS
Definition: beagle.h:182
BEAGLE_FLAG_FRAMEWORK_CPU
@ BEAGLE_FLAG_FRAMEWORK_CPU
Definition: beagle.h:180
BeagleInstanceDetails::implDescription
char * implDescription
Definition: beagle.h:223
beagleSetPartials
BEAGLE_DLLEXPORT int beagleSetPartials(int instance, int bufferIndex, const double *inPartials)
Set an instance partials buffer.
beagleGetVersion
const BEAGLE_DLLEXPORT char * beagleGetVersion(void)
Get version.
BEAGLE_FLAG_PROCESSOR_CPU
@ BEAGLE_FLAG_PROCESSOR_CPU
Definition: beagle.h:171
BEAGLE_ERROR_UNINITIALIZED_INSTANCE
@ BEAGLE_ERROR_UNINITIALIZED_INSTANCE
Definition: beagle.h:125
beagleRemoveScaleFactors
BEAGLE_DLLEXPORT int beagleRemoveScaleFactors(int instance, const int *scaleIndices, int count, int cumulativeScaleIndex)
Remove scale factors.
BEAGLE_FLAG_SCALING_AUTO
@ BEAGLE_FLAG_SCALING_AUTO
Definition: beagle.h:153
BeagleBenchmarkedResource
Description of a benchmarked hardware resource.
Definition: beagle.h:249
beagleResetScaleFactorsByPartition
BEAGLE_DLLEXPORT int beagleResetScaleFactorsByPartition(int instance, int cumulativeScaleIndex, int partitionIndex)
Reset scalefactors by partition.
BeagleBenchmarkedResourceList::list
BeagleBenchmarkedResource * list
Definition: beagle.h:268
BEAGLE_FLAG_THREADING_OPENMP
@ BEAGLE_FLAG_THREADING_OPENMP
Definition: beagle.h:168
beagleSetTransitionMatrix
BEAGLE_DLLEXPORT int beagleSetTransitionMatrix(int instance, int matrixIndex, const double *inMatrix, double paddedValue)
Set a finite-time transition probability matrix.
beagleSetTipStates
BEAGLE_DLLEXPORT int beagleSetTipStates(int instance, int tipIndex, const int *inStates)
Set the compact state representation for tip node.
BeagleOperationByPartition::child2Partials
int child2Partials
Definition: beagle.h:813
BeagleFlags
BeagleFlags
Hardware and implementation capability flags.
Definition: beagle.h:142
BeagleOpCodes
BeagleOpCodes
Operation codes.
Definition: beagle.h:208
BeagleOperation::child2Partials
int child2Partials
Definition: beagle.h:781
BEAGLE_ERROR_OUT_OF_RANGE
@ BEAGLE_ERROR_OUT_OF_RANGE
Definition: beagle.h:127
BeagleBenchmarkedResource::requiredFlags
long requiredFlags
Definition: beagle.h:254
beagleGetDerivatives
BEAGLE_DLLEXPORT int beagleGetDerivatives(int instance, double *outSumFirstDerivative, double *outSumSecondDerivative)
Returns derivative sums subsequent to an asynchronous integration call.
BEAGLE_BENCHFLAG_SCALING_DYNAMIC
@ BEAGLE_BENCHFLAG_SCALING_DYNAMIC
Definition: beagle.h:198
beagleGetPartials
BEAGLE_DLLEXPORT int beagleGetPartials(int instance, int bufferIndex, int scaleIndex, double *outPartials)
Get partials from an instance buffer.
BeagleOperationByPartition::partition
int partition
Definition: beagle.h:815
beagleSetPatternPartitions
BEAGLE_DLLEXPORT int beagleSetPatternPartitions(int instance, int partitionCount, const int *inPatternPartitions)
Set pattern partition assignments.
beagleAccumulateScaleFactors
BEAGLE_DLLEXPORT int beagleAccumulateScaleFactors(int instance, const int *scaleIndices, int count, int cumulativeScaleIndex)
Accumulate scale factors.
beagleGetTransitionMatrix
BEAGLE_DLLEXPORT int beagleGetTransitionMatrix(int instance, int matrixIndex, double *outMatrix)
Get a finite-time transition probability matrix.
BeagleOperation::child1Partials
int child1Partials
Definition: beagle.h:779
beagleGetCitation
const BEAGLE_DLLEXPORT char * beagleGetCitation(void)
Get citation.
beagleWaitForPartials
BEAGLE_DLLEXPORT int beagleWaitForPartials(const int instance, const int *destinationPartials, int destinationPartialsCount)
Block until all calculations that write to the specified partials have completed.
beagleGetBenchmarkedResourceList
BEAGLE_DLLEXPORT BeagleBenchmarkedResourceList * beagleGetBenchmarkedResourceList(int tipCount, int compactBufferCount, int stateCount, int patternCount, int categoryCount, int *resourceList, int resourceCount, long preferenceFlags, long requirementFlags, int eigenModelCount, int partitionCount, int calculateDerivatives, long benchmarkFlags)
Get a benchmarked list of hardware resources for the given analysis parameters.
BEAGLE_OP_NONE
@ BEAGLE_OP_NONE
Definition: beagle.h:211
BeagleBenchmarkFlags
BeagleBenchmarkFlags
Benchmarking mode flags for resource performance evaluation with beagleGetOrderedResourceList.
Definition: beagle.h:195
BEAGLE_FLAG_INVEVEC_TRANSPOSED
@ BEAGLE_FLAG_INVEVEC_TRANSPOSED
Definition: beagle.h:161
beagleCalculateRootLogLikelihoodsByPartition
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.
BeagleOperationByPartition
A list of integer indices which specify a partial likelihoods operation for a partitioned analysis.
Definition: beagle.h:807
BeagleBenchmarkedResourceList
Ordered list of benchmarked hardware resources, from fastest to slowest.
Definition: beagle.h:267
BeagleOperation::child1TransitionMatrix
int child1TransitionMatrix
Definition: beagle.h:780
beagleSetTransitionMatrices
BEAGLE_DLLEXPORT int beagleSetTransitionMatrices(int instance, const int *matrixIndices, const double *inMatrices, const double *paddedValues, int count)
Set multiple transition matrices.
BEAGLE_FLAG_SCALERS_LOG
@ BEAGLE_FLAG_SCALERS_LOG
Definition: beagle.h:158
beagleUpdatePartialsByPartition
BEAGLE_DLLEXPORT int beagleUpdatePartialsByPartition(const int instance, const BeagleOperationByPartition *operations, int operationCount)
Calculate or queue for calculation partials using a list of partition operations.
BEAGLE_FLAG_THREADING_NONE
@ BEAGLE_FLAG_THREADING_NONE
Definition: beagle.h:169
BEAGLE_FLAG_PRECISION_SINGLE
@ BEAGLE_FLAG_PRECISION_SINGLE
Definition: beagle.h:143
BeagleBenchmarkedResource::name
char * name
Definition: beagle.h:251
BEAGLE_ERROR_GENERAL
@ BEAGLE_ERROR_GENERAL
Definition: beagle.h:122
BEAGLE_FLAG_PARALLELOPS_GRID
@ BEAGLE_FLAG_PARALLELOPS_GRID
Definition: beagle.h:183
beagleGetSiteLogLikelihoods
BEAGLE_DLLEXPORT int beagleGetSiteLogLikelihoods(int instance, double *outLogLikelihoods)
Get site log likelihoods for last beagleCalculateRootLogLikelihoods or beagleCalculateEdgeLogLikeliho...
BEAGLE_ERROR_FLOATING_POINT
@ BEAGLE_ERROR_FLOATING_POINT
Definition: beagle.h:131
beagleCalculateEdgeLogLikelihoodsByPartition
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.
BEAGLE_SUCCESS
@ BEAGLE_SUCCESS
Definition: beagle.h:121
beagleSetCategoryRatesWithIndex
BEAGLE_DLLEXPORT int beagleSetCategoryRatesWithIndex(int instance, int categoryRatesIndex, const double *inCategoryRates)
Set a category rates buffer.
BEAGLE_FLAG_COMPUTATION_ASYNCH
@ BEAGLE_FLAG_COMPUTATION_ASYNCH
Definition: beagle.h:147
beagleSetPatternWeights
BEAGLE_DLLEXPORT int beagleSetPatternWeights(int instance, const double *inPatternWeights)
Set pattern weights.
beagleSetStateFrequencies
BEAGLE_DLLEXPORT int beagleSetStateFrequencies(int instance, int stateFrequenciesIndex, const double *inStateFrequencies)
Set a state frequency buffer.
BEAGLE_ERROR_NO_RESOURCE
@ BEAGLE_ERROR_NO_RESOURCE
Definition: beagle.h:129
BEAGLE_FLAG_PROCESSOR_GPU
@ BEAGLE_FLAG_PROCESSOR_GPU
Definition: beagle.h:172
BeagleOperation::destinationPartials
int destinationPartials
Definition: beagle.h:776
BeagleBenchmarkedResource::implName
char * implName
Definition: beagle.h:256
BeagleOperation::destinationScaleWrite
int destinationScaleWrite
Definition: beagle.h:777
BeagleResource::description
char * description
Definition: beagle.h:233
beagleSetCategoryWeights
BEAGLE_DLLEXPORT int beagleSetCategoryWeights(int instance, int categoryWeightsIndex, const double *inCategoryWeights)
Set a category weights buffer.
beagleCopyScaleFactors
BEAGLE_DLLEXPORT int beagleCopyScaleFactors(int instance, int destScalingIndex, int srcScalingIndex)
Copy scale factors.
BEAGLE_ERROR_NO_IMPLEMENTATION
@ BEAGLE_ERROR_NO_IMPLEMENTATION
Definition: beagle.h:130
BEAGLE_FLAG_INVEVEC_STANDARD
@ BEAGLE_FLAG_INVEVEC_STANDARD
Definition: beagle.h:160
beagleCalculateEdgeLogLikelihoods
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.
beagleGetLogLikelihood
BEAGLE_DLLEXPORT int beagleGetLogLikelihood(int instance, double *outSumLogLikelihood)
Returns log likelihood sum and subsequent to an asynchronous integration call.
beagleFinalize
BEAGLE_DLLEXPORT int beagleFinalize(void)
Finalize the library.
BeagleInstanceDetails::resourceName
char * resourceName
Definition: beagle.h:219
beagleAccumulateScaleFactorsByPartition
BEAGLE_DLLEXPORT int beagleAccumulateScaleFactorsByPartition(int instance, const int *scaleIndices, int count, int cumulativeScaleIndex, int partitionIndex)
Accumulate scale factors by partition.
BEAGLE_FLAG_SCALERS_RAW
@ BEAGLE_FLAG_SCALERS_RAW
Definition: beagle.h:157
BEAGLE_FLAG_PRECISION_DOUBLE
@ BEAGLE_FLAG_PRECISION_DOUBLE
Definition: beagle.h:144
BEAGLE_FLAG_PROCESSOR_PHI
@ BEAGLE_FLAG_PROCESSOR_PHI
Definition: beagle.h:175
BeagleOperation::destinationScaleRead
int destinationScaleRead
Definition: beagle.h:778
BEAGLE_PARTITION_OP_COUNT
@ BEAGLE_PARTITION_OP_COUNT
Definition: beagle.h:210
BeagleOperation::child2TransitionMatrix
int child2TransitionMatrix
Definition: beagle.h:782
BeagleResourceList
List of hardware resources.
Definition: beagle.h:241
BEAGLE_FLAG_PROCESSOR_OTHER
@ BEAGLE_FLAG_PROCESSOR_OTHER
Definition: beagle.h:176
beagleFinalizeInstance
BEAGLE_DLLEXPORT int beagleFinalizeInstance(int instance)
Finalize this instance.
BeagleResourceList::length
int length
Definition: beagle.h:243
beagleCalculateRootLogLikelihoods
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.
beagleUpdateTransitionMatrices
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.
beagleUpdatePartials
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.
BeagleBenchmarkedResource::returnCode
int returnCode
Definition: beagle.h:255
BeagleInstanceDetails::flags
long flags
Definition: beagle.h:224
beagleRemoveScaleFactorsByPartition
BEAGLE_DLLEXPORT int beagleRemoveScaleFactorsByPartition(int instance, const int *scaleIndices, int count, int cumulativeScaleIndex, int partitionIndex)
Remove scale factors by partition.
BeagleBenchmarkedResourceList::length
int length
Definition: beagle.h:269
BEAGLE_FLAG_FRAMEWORK_OPENCL
@ BEAGLE_FLAG_FRAMEWORK_OPENCL
Definition: beagle.h:179
BEAGLE_FLAG_FRAMEWORK_CUDA
@ BEAGLE_FLAG_FRAMEWORK_CUDA
Definition: beagle.h:178
BeagleBenchmarkedResource::description
char * description
Definition: beagle.h:252
BEAGLE_FLAG_THREADING_CPP
@ BEAGLE_FLAG_THREADING_CPP
Definition: beagle.h:167
BeagleBenchmarkedResource::benchedFlags
long benchedFlags
Definition: beagle.h:257
BeagleBenchmarkedResource::number
int number
Definition: beagle.h:250
BeagleOperation
A list of integer indices which specify a partial likelihoods operation.
Definition: beagle.h:775
BeagleBenchmarkedResource::performanceRatio
double performanceRatio
Definition: beagle.h:260
BEAGLE_OP_COUNT
@ BEAGLE_OP_COUNT
Definition: beagle.h:209
BeagleOperationByPartition::cumulativeScaleIndex
int cumulativeScaleIndex
Definition: beagle.h:816
BEAGLE_ERROR_UNIDENTIFIED_EXCEPTION
@ BEAGLE_ERROR_UNIDENTIFIED_EXCEPTION
Definition: beagle.h:124
BEAGLE_FLAG_SCALING_ALWAYS
@ BEAGLE_FLAG_SCALING_ALWAYS
Definition: beagle.h:154
beagleCreateInstance
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.
BEAGLE_FLAG_SCALING_MANUAL
@ BEAGLE_FLAG_SCALING_MANUAL
Definition: beagle.h:152
BEAGLE_FLAG_VECTOR_NONE
@ BEAGLE_FLAG_VECTOR_NONE
Definition: beagle.h:165
BEAGLE_FLAG_VECTOR_SSE
@ BEAGLE_FLAG_VECTOR_SSE
Definition: beagle.h:163
BeagleOperationByPartition::destinationScaleWrite
int destinationScaleWrite
Definition: beagle.h:809
BEAGLE_BENCHFLAG_SCALING_ALWAYS
@ BEAGLE_BENCHFLAG_SCALING_ALWAYS
Definition: beagle.h:197
BeagleInstanceDetails::implName
char * implName
Definition: beagle.h:221
beagleGetScaleFactors
BEAGLE_DLLEXPORT int beagleGetScaleFactors(int instance, int srcScalingIndex, double *outScaleFactors)
Get scale factors.
BEAGLE_FLAG_PROCESSOR_CELL
@ BEAGLE_FLAG_PROCESSOR_CELL
Definition: beagle.h:174
BeagleOperationByPartition::child1Partials
int child1Partials
Definition: beagle.h:811
beagleResetScaleFactors
BEAGLE_DLLEXPORT int beagleResetScaleFactors(int instance, int cumulativeScaleIndex)
Reset scalefactors.
BEAGLE_FLAG_VECTOR_AVX
@ BEAGLE_FLAG_VECTOR_AVX
Definition: beagle.h:164
BEAGLE_BENCHFLAG_SCALING_NONE
@ BEAGLE_BENCHFLAG_SCALING_NONE
Definition: beagle.h:196
BEAGLE_FLAG_EIGEN_REAL
@ BEAGLE_FLAG_EIGEN_REAL
Definition: beagle.h:149
BeagleBenchmarkedResource::supportFlags
long supportFlags
Definition: beagle.h:253
BeagleOperationByPartition::destinationScaleRead
int destinationScaleRead
Definition: beagle.h:810
BeagleResource::requiredFlags
long requiredFlags
Definition: beagle.h:235
beagleGetResourceList
BEAGLE_DLLEXPORT BeagleResourceList * beagleGetResourceList(void)
Get list of hardware resources.
BeagleReturnCodes
BeagleReturnCodes
Error return codes.
Definition: beagle.h:120
BeagleInstanceDetails
Information about a specific instance.
Definition: beagle.h:217
BeagleResource::supportFlags
long supportFlags
Definition: beagle.h:234
BeagleResourceList::list
BeagleResource * list
Definition: beagle.h:242
BeagleResource
Description of a hardware resource.
Definition: beagle.h:231
BEAGLE_FLAG_COMPUTATION_SYNCH
@ BEAGLE_FLAG_COMPUTATION_SYNCH
Definition: beagle.h:146
BeagleResource::name
char * name
Definition: beagle.h:232
beagleGetSiteDerivatives
BEAGLE_DLLEXPORT int beagleGetSiteDerivatives(int instance, double *outFirstDerivatives, double *outSecondDerivatives)
Get site derivatives for last beagleCalculateEdgeLogLikelihoods call.
beagleConvolveTransitionMatrices
BEAGLE_DLLEXPORT int beagleConvolveTransitionMatrices(int instance, const int *firstIndices, const int *secondIndices, const int *resultIndices, int matrixCount)
Set partitions by pattern weight.
beagleSetCPUThreadCount
BEAGLE_DLLEXPORT int beagleSetCPUThreadCount(int instance, int threadCount)
Set number of threads for native CPU implementation.
BeagleInstanceDetails::resourceNumber
int resourceNumber
Definition: beagle.h:218
beagleSetTipPartials
BEAGLE_DLLEXPORT int beagleSetTipPartials(int instance, int tipIndex, const double *inPartials)
Set an instance partials buffer for tip node.
BeagleBenchmarkedResource::benchmarkResult
double benchmarkResult
Definition: beagle.h:259