Functions | Variables
evaluateGenericSpecial.c File Reference

Functions for computing the log likelihood at a given branch of the tree (i.e. a virtual root that is placed at this branch) More...

Functions

void pllEvaluateIterative (pllInstance *tr, partitionList *pr, boolean getPerSiteLikelihoods)
 Evaluate the log likelihood of a specific branch of the topology. More...
 
void pllEvaluateGeneric (pllInstance *tr, partitionList *pr, nodeptr p, boolean fullTraversal, boolean getPerSiteLikelihoods)
 Evaluate the log likelihood of the tree topology. More...
 
void perSiteLogLikelihoods (pllInstance *tr, partitionList *pr, double *logLikelihoods)
 

Static functions

static double evaluateGTRGAMMAPROT_LG4 (int *ex1, int *ex2, int *wptr, double *x1, double *x2, double *tipVector[4], unsigned char *tipX1, int n, double *diagptable, const boolean fastScaling)
 Evaluation of log likelihood of a tree under the GAMMA model of rate heterogeneity and LG4 model of evolution. More...
 
static double evaluateGTRGAMMAPROT_GAPPED_SAVE (const boolean fastScaling, int *ex1, int *ex2, int *wptr, double *x1, double *x2, double *tipVector, unsigned char *tipX1, int n, double *diagptable, double *x1_gapColumn, double *x2_gapColumn, unsigned int *x1_gap, unsigned int *x2_gap)
 Evaluation of log likelihood of a tree using the GAMMA model of rate heterogeneity and the memory saving technique (Optimized SSE3 version for AA data) More...
 
static double evaluateGTRGAMMAPROT (const boolean fastScaling, int *ex1, int *ex2, int *wptr, double *x1, double *x2, double *tipVector, unsigned char *tipX1, int n, double *diagptable)
 Evaluation of log likelihood of a tree using the GAMMA model of rate heterogeneity (Optimized SSE3 version for AA data) More...
 
static double evaluateGTRCATPROT (const boolean fastScaling, int *ex1, int *ex2, int *cptr, int *wptr, double *x1, double *x2, double *tipVector, unsigned char *tipX1, int n, double *diagptable_start)
 Evaluation of log likelihood of a tree using the CAT model of rate heterogeneity (Optimized SSE3 version for AA data) More...
 
static double evaluateGTRCATPROT_SAVE (const boolean fastScaling, int *ex1, int *ex2, int *cptr, int *wptr, double *x1, double *x2, double *tipVector, unsigned char *tipX1, int n, double *diagptable_start, double *x1_gapColumn, double *x2_gapColumn, unsigned int *x1_gap, unsigned int *x2_gap)
 Evaluation of log likelihood of a tree using the CAT model of rate heterogeneity with memory saving (Optimized SSE3 version for AA data) More...
 
static double evaluateGTRCAT_SAVE (const boolean fastScaling, int *ex1, int *ex2, int *cptr, int *wptr, double *x1_start, double *x2_start, double *tipVector, unsigned char *tipX1, int n, double *diagptable_start, double *x1_gapColumn, double *x2_gapColumn, unsigned int *x1_gap, unsigned int *x2_gap)
 Evaluation of log likelihood of a tree using the CAT model of rate heterogeneity with memory saving (Optimized SSE3 version for DNA data) More...
 
static double evaluateGTRGAMMA_GAPPED_SAVE (const boolean fastScaling, int *ex1, int *ex2, int *wptr, double *x1_start, double *x2_start, double *tipVector, unsigned char *tipX1, const int n, double *diagptable, double *x1_gapColumn, double *x2_gapColumn, unsigned int *x1_gap, unsigned int *x2_gap)
 Evaluation of log likelihood of a tree using the GAMMA model of rate heterogeneity with memory saving (Optimized SSE3 version for DNA data) More...
 
static double evaluateGTRGAMMA (const boolean fastScaling, int *ex1, int *ex2, int *wptr, double *x1_start, double *x2_start, double *tipVector, unsigned char *tipX1, const int n, double *diagptable)
 Evaluation of log likelihood of a tree using the GAMMA model of rate heterogeneity (Optimized SSE3 version for DNA data) More...
 
static double evaluateGTRCAT (const boolean fastScaling, int *ex1, int *ex2, int *cptr, int *wptr, double *x1_start, double *x2_start, double *tipVector, unsigned char *tipX1, int n, double *diagptable_start)
 Evaluation of log likelihood of a tree using the CAT model of rate heterogeneity (Optimized SSE3 version for DNA data) More...
 
static void calcDiagptable (const double z, const int states, const int numberOfCategories, const double *rptr, const double *EIGN, double *diagptable)
 Compute the diagonal of P matrix for a specific edge. More...
 
static void calcDiagptableFlex_LG4 (double z, int numberOfCategories, double *rptr, double *EIGN[4], double *diagptable, const int numStates)
 Compute the diagonal of P matrix for a specific edge for the LG4 model. More...
 
static double evaluateGAMMA_FLEX (const boolean fastScaling, int *ex1, int *ex2, int *wptr, double *x1_start, double *x2_start, double *tipVector, unsigned char *tipX1, const int n, double *diagptable, const int states, double *perSiteLikelihoods, boolean getPerSiteLikelihoods)
 A generic (and slow) implementation of log likelihood evaluation of a tree using the GAMMA model of rate heterogeneity. More...
 
static double evaluateGAMMA_FLEX_SAVE (const boolean fastScaling, int *ex1, int *ex2, int *wptr, double *x1_start, double *x2_start, double *tipVector, unsigned char *tipX1, const int n, double *diagptable, const int states, double *perSiteLikelihoods, boolean getPerSiteLikelihoods, double *x1_gapColumn, double *x2_gapColumn, unsigned int *x1_gap, unsigned int *x2_gap)
 Memory saving version of the generic (and slow) implementation of log likelihood evaluation of a tree using the GAMMA model of rate heterogeneity. More...
 
static double evaluateCAT_FLEX (const boolean fastScaling, int *ex1, int *ex2, int *cptr, int *wptr, double *x1, double *x2, double *tipVector, unsigned char *tipX1, int n, double *diagptable_start, const int states, double *perSiteLikelihoods, boolean getPerSiteLikelihoods)
 A generic (and slow) implementation of log likelihood evaluation of a tree using the CAT model of rate heterogeneity. More...
 
static double evaluateCAT_FLEX_SAVE (const boolean fastScaling, int *ex1, int *ex2, int *cptr, int *wptr, double *x1, double *x2, double *tipVector, unsigned char *tipX1, int n, double *diagptable_start, const int states, double *perSiteLikelihoods, boolean getPerSiteLikelihoods, double *x1_gapColumn, double *x2_gapColumn, unsigned int *x1_gap, unsigned int *x2_gap)
 A generic (and slow) implementation of log likelihood evaluation of a tree using the CAT model of rate heterogeneity with memory saving. More...
 

Variables

const unsigned int mask32 [32]
 Array for setting bits 0 .. 31 in a bit vector, used in saveMemory technique for the gapVector.
 

Detailed Description

Functions for computing the log likelihood at a given branch of the tree (i.e. a virtual root that is placed at this branch)

Function Documentation

static void calcDiagptable ( const double  z,
const int  states,
const int  numberOfCategories,
const double *  rptr,
const double *  EIGN,
double *  diagptable 
)
static

Compute the diagonal of P matrix for a specific edge.

This function computes the diagonal of P matrix for a branch of length z from the decomposition of the Q matrix specified in EIGN and the respective rate categories rptr for a single partition. The diagonal is then stored in diagptable.

Parameters
zLength of edge
statesNumber of states
numberOfCategoriesNumber of categories in the rate heterogeneity rate arrays
rptrRate heterogeneity rate arrays
EIGNEigenvalues
diagptableWhere to store the resulting P matrix

+ Here is the caller graph for this function:

static void calcDiagptableFlex_LG4 ( double  z,
int  numberOfCategories,
double *  rptr,
double *  EIGN[4],
double *  diagptable,
const int  numStates 
)
static

Compute the diagonal of P matrix for a specific edge for the LG4 model.

This function computes the diagonal of P matrix for a branch of length z from the decomposition of the 4 LG4 Q matrices specified in EIGN and the respective rate categories rptr for a single partition. The diagonal is then stored in diagptable.

Parameters
zLength of edge
statesNumber of states
numberOfCategoriesNumber of categories in the rate heterogeneity rate arrays
rptrRate heterogeneity rate arrays
EIGNEigenvalues of the 4 Q matrices
diagptableWhere to store the resulting P matrix
numStatesNumber of states

+ Here is the caller graph for this function: