1 #ifndef __LIKELIHOOD_H__
2 #define __LIKELIHOOD_H__
4 //#define TIMING_ANALIZ
5 #if defined (TIMING_ANALIZ)
6 static clock_t CPUCondLikeDown;
7 static clock_t CPUScalers;
8 static clock_t CPUScalersRemove;
9 static clock_t CPUCondLikeRoot;
10 static clock_t CPULilklihood;
12 #define TIME(X1,CPUtime)\
13 {CPUTimeStart = clock();\
15 CPUtime += (clock()-CPUTimeStart);}
17 #define TIME(X1,CPUtime)\
42 CLFlt *preLikeL; /* precalculated cond likes for left descendant */
43 CLFlt *preLikeR; /* precalculated cond likes for right descendant*/
44 CLFlt *preLikeA; /* precalculated cond likes for ancestor */
46 int CondLikeDown_Bin (TreeNode *p, int division, int chain);
47 #if defined (SSE_ENABLED)
48 int CondLikeDown_Bin_SSE (TreeNode *p, int division, int chain);
50 int CondLikeDown_Gen (TreeNode *p, int division, int chain);
51 #if defined (SSE_ENABLED)
52 int CondLikeDown_Gen_SSE (TreeNode *p, int division, int chain);
54 int CondLikeDown_Gen_GibbsGamma (TreeNode *p, int division, int chain);
55 int CondLikeDown_NUC4 (TreeNode *p, int division, int chain);
56 #if defined (SSE_ENABLED)
57 int CondLikeDown_NUC4_SSE (TreeNode *p, int division, int chain);
59 int CondLikeDown_NUC4_GibbsGamma (TreeNode *p, int division, int chain);
60 int CondLikeDown_NY98 (TreeNode *p, int division, int chain);
61 #if defined (SSE_ENABLED)
62 int CondLikeDown_NY98_SSE (TreeNode *p, int division, int chain);
64 int CondLikeDown_Std (TreeNode *p, int division, int chain);
65 int CondLikeRoot_Bin (TreeNode *p, int division, int chain);
66 #if defined (SSE_ENABLED)
67 int CondLikeRoot_Bin_SSE (TreeNode *p, int division, int chain);
69 int CondLikeRoot_Gen (TreeNode *p, int division, int chain);
70 #if defined (SSE_ENABLED)
71 int CondLikeRoot_Gen_SSE (TreeNode *p, int division, int chain);
73 int CondLikeRoot_Gen_GibbsGamma (TreeNode *p, int division, int chain);
74 int CondLikeRoot_NUC4 (TreeNode *p, int division, int chain);
75 #if defined (SSE_ENABLED)
76 int CondLikeRoot_NUC4_SSE (TreeNode *p, int division, int chain);
78 int CondLikeRoot_NUC4_GibbsGamma (TreeNode *p, int division, int chain);
79 int CondLikeRoot_NY98 (TreeNode *p, int division, int chain);
80 #if defined (SSE_ENABLED)
81 int CondLikeRoot_NY98_SSE (TreeNode *p, int division, int chain);
83 int CondLikeRoot_Std (TreeNode *p, int division, int chain);
84 int CondLikeScaler_Gen (TreeNode *p, int division, int chain);
85 #if defined (SSE_ENABLED)
86 int CondLikeScaler_Gen_SSE (TreeNode *p, int division, int chain);
88 int CondLikeScaler_Gen_GibbsGamma (TreeNode *p, int division, int chain);
89 int CondLikeScaler_NUC4 (TreeNode *p, int division, int chain);
90 #if defined (SSE_ENABLED)
91 int CondLikeScaler_NUC4_SSE (TreeNode *p, int division, int chain);
93 int CondLikeScaler_NUC4_GibbsGamma (TreeNode *p, int division, int chain);
94 int CondLikeScaler_NY98 (TreeNode *p, int division, int chain);
95 #if defined (SSE_ENABLED)
96 int CondLikeScaler_NY98_SSE (TreeNode *p, int division, int chain);
98 int CondLikeScaler_Std (TreeNode *p, int division, int chain);
99 int CondLikeUp_Bin (TreeNode *p, int division, int chain);
100 int CondLikeUp_Gen (TreeNode *p, int division, int chain);
101 int CondLikeUp_NUC4 (TreeNode *p, int division, int chain);
102 int CondLikeUp_Std (TreeNode *p, int division, int chain);
103 void LaunchLogLikeForDivision (int chain, int d, MrBFlt* lnL);
104 int Likelihood_Adgamma (TreeNode *p, int division, int chain, MrBFlt *lnL, int whichSitePats);
105 int Likelihood_Gen (TreeNode *p, int division, int chain, MrBFlt *lnL, int whichSitePats);
106 #if defined (SSE_ENABLED)
107 int Likelihood_Gen_SSE (TreeNode *p, int division, int chain, MrBFlt *lnL, int whichSitePats);
109 int Likelihood_Gen_GibbsGamma (TreeNode *p, int division, int chain, MrBFlt *lnL, int whichSitePats);
110 int Likelihood_NUC4 (TreeNode *p, int division, int chain, MrBFlt *lnL, int whichSitePats);
111 #if defined (SSE_ENABLED)
112 int Likelihood_NUC4_SSE (TreeNode *p, int division, int chain, MrBFlt *lnL, int whichSitePats);
114 int Likelihood_NUC4_GibbsGamma (TreeNode *p, int division, int chain, MrBFlt *lnL, int whichSitePats);
115 int Likelihood_NY98 (TreeNode *p, int division, int chain, MrBFlt *lnL, int whichSitePats);
116 #if defined (SSE_ENABLED)
117 int Likelihood_NY98_SSE (TreeNode *p, int division, int chain, MrBFlt *lnL, int whichSitePats);
119 int Likelihood_Pars (TreeNode *p, int division, int chain, MrBFlt *lnL, int whichSitePats);
120 int Likelihood_ParsStd (TreeNode *p, int division, int chain, MrBFlt *lnL, int whichSitePats);
121 int Likelihood_Res (TreeNode *p, int division, int chain, MrBFlt *lnL, int whichSitePats);
122 #if defined (SSE_ENABLED)
123 int Likelihood_Res_SSE (TreeNode *p, int division, int chain, MrBFlt *lnL, int whichSitePats);
125 int Likelihood_Std (TreeNode *p, int division, int chain, MrBFlt *lnL, int whichSitePats);
126 int TiProbs_Fels (TreeNode *p, int division, int chain);
127 int TiProbs_Gen (TreeNode *p, int division, int chain);
128 int TiProbs_GenCov (TreeNode *p, int division, int chain);
129 int TiProbs_Hky (TreeNode *p, int division, int chain);
130 int TiProbs_JukesCantor (TreeNode *p, int division, int chain);
131 int TiProbs_Std (TreeNode *p, int division, int chain);
132 int TiProbs_Res (TreeNode *p, int division, int chain);
134 #endif /* __LIKELIHOOD_H__ */