1 #ifndef __LIKELIHOOD_H__
2 #define __LIKELIHOOD_H__
3 
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;
11 
12     #define TIME(X1,CPUtime)\
13         {CPUTimeStart = clock();\
14         X1;\
15         CPUtime += (clock()-CPUTimeStart);}
16 #else
17     #define TIME(X1,CPUtime)\
18         X1;
19 #endif
20 
21 #define A                           0
22 #define C                           1
23 #define G                           2
24 #define T                           3
25 #define AA                          0
26 #define AC                          1
27 #define AG                          2
28 #define AT                          3
29 #define CA                          4
30 #define CC                          5
31 #define CG                          6
32 #define CT                          7
33 #define GA                          8
34 #define GC                          9
35 #define GG                          10
36 #define GT                          11
37 #define TA                          12
38 #define TC                          13
39 #define TG                          14
40 #define TT                          15
41 
42 int       CondLikeDown_Bin (TreeNode *p, int division, int chain);
43 #if defined (SSE_ENABLED)
44 int       CondLikeDown_Bin_SSE (TreeNode *p, int division, int chain);
45 #endif
46 int       CondLikeDown_Gen (TreeNode *p, int division, int chain);
47 #if defined (SSE_ENABLED)
48 int       CondLikeDown_Gen_SSE (TreeNode *p, int division, int chain);
49 #endif
50 int       CondLikeDown_Gen_GibbsGamma (TreeNode *p, int division, int chain);
51 int       CondLikeDown_NUC4 (TreeNode *p, int division, int chain);
52 #if defined (FMA_ENABLED)
53 int       CondLikeDown_NUC4_FMA (TreeNode *p, int division, int chain);
54 #endif
55 #if defined (AVX_ENABLED)
56 int       CondLikeDown_NUC4_AVX (TreeNode *p, int division, int chain);
57 #endif
58 #if defined (SSE_ENABLED)
59 int       CondLikeDown_NUC4_SSE (TreeNode *p, int division, int chain);
60 #endif
61 int       CondLikeDown_NUC4_GibbsGamma (TreeNode *p, int division, int chain);
62 int       CondLikeDown_NY98 (TreeNode *p, int division, int chain);
63 #if defined (SSE_ENABLED)
64 int       CondLikeDown_NY98_SSE (TreeNode *p, int division, int chain);
65 #endif
66 int       CondLikeDown_Std (TreeNode *p, int division, int chain);
67 int       CondLikeRoot_Bin (TreeNode *p, int division, int chain);
68 #if defined (SSE_ENABLED)
69 int       CondLikeRoot_Bin_SSE (TreeNode *p, int division, int chain);
70 #endif
71 int       CondLikeRoot_Gen (TreeNode *p, int division, int chain);
72 #if defined (SSE_ENABLED)
73 int       CondLikeRoot_Gen_SSE (TreeNode *p, int division, int chain);
74 #endif
75 int       CondLikeRoot_Gen_GibbsGamma (TreeNode *p, int division, int chain);
76 int       CondLikeRoot_NUC4 (TreeNode *p, int division, int chain);
77 #if defined (FMA_ENABLED)
78 int       CondLikeRoot_NUC4_FMA (TreeNode *p, int division, int chain);
79 #endif
80 #if defined (AVX_ENABLED)
81 int       CondLikeRoot_NUC4_AVX (TreeNode *p, int division, int chain);
82 #endif
83 #if defined (SSE_ENABLED)
84 int       CondLikeRoot_NUC4_SSE (TreeNode *p, int division, int chain);
85 #endif
86 int       CondLikeRoot_NUC4_GibbsGamma (TreeNode *p, int division, int chain);
87 int       CondLikeRoot_NY98 (TreeNode *p, int division, int chain);
88 #if defined (SSE_ENABLED)
89 int       CondLikeRoot_NY98_SSE (TreeNode *p, int division, int chain);
90 #endif
91 int       CondLikeRoot_Std (TreeNode *p, int division, int chain);
92 int       CondLikeScaler_Gen (TreeNode *p, int division, int chain);
93 #if defined (SSE_ENABLED)
94 int       CondLikeScaler_Gen_SSE (TreeNode *p, int division, int chain);
95 #endif
96 int       CondLikeScaler_Gen_GibbsGamma (TreeNode *p, int division, int chain);
97 int       CondLikeScaler_NUC4 (TreeNode *p, int division, int chain);
98 #if defined (AVX_ENABLED)
99 int       CondLikeScaler_NUC4_AVX (TreeNode *p, int division, int chain);
100 #endif
101 #if defined (SSE_ENABLED)
102 int       CondLikeScaler_NUC4_SSE (TreeNode *p, int division, int chain);
103 #endif
104 int       CondLikeScaler_NUC4_GibbsGamma (TreeNode *p, int division, int chain);
105 int       CondLikeScaler_NY98 (TreeNode *p, int division, int chain);
106 #if defined (SSE_ENABLED)
107 int       CondLikeScaler_NY98_SSE (TreeNode *p, int division, int chain);
108 #endif
109 int       CondLikeScaler_Std (TreeNode *p, int division, int chain);
110 int       CondLikeUp_Bin (TreeNode *p, int division, int chain);
111 int       CondLikeUp_Gen (TreeNode *p, int division, int chain);
112 int       CondLikeUp_NUC4 (TreeNode *p, int division, int chain);
113 int       CondLikeUp_Std (TreeNode *p, int division, int chain);
114 #if defined(BEAGLE_V3_ENABLED)
115 void      LaunchLogLikeForBeagleMultiPartition(int chain, MrBFlt* lnL);
116 #endif
117 void      LaunchLogLikeForDivision (int chain, int d, MrBFlt* lnL);
118 int       Likelihood_Adgamma (TreeNode *p, int division, int chain, MrBFlt *lnL, int whichSitePats);
119 int       Likelihood_Gen (TreeNode *p, int division, int chain, MrBFlt *lnL, int whichSitePats);
120 #if defined (SSE_ENABLED)
121 int       Likelihood_Gen_SSE (TreeNode *p, int division, int chain, MrBFlt *lnL, int whichSitePats);
122 #endif
123 int       Likelihood_Gen_GibbsGamma (TreeNode *p, int division, int chain, MrBFlt *lnL, int whichSitePats);
124 int       Likelihood_NUC4 (TreeNode *p, int division, int chain, MrBFlt *lnL, int whichSitePats);
125 #if defined (FMA_ENABLED)
126 int       Likelihood_NUC4_FMA (TreeNode *p, int division, int chain, MrBFlt *lnL, int whichSitePats);
127 #endif
128 #if defined (AVX_ENABLED)
129 int       Likelihood_NUC4_AVX (TreeNode *p, int division, int chain, MrBFlt *lnL, int whichSitePats);
130 #endif
131 #if defined (SSE_ENABLED)
132 int       Likelihood_NUC4_SSE (TreeNode *p, int division, int chain, MrBFlt *lnL, int whichSitePats);
133 #endif
134 int       Likelihood_NUC4_GibbsGamma (TreeNode *p, int division, int chain, MrBFlt *lnL, int whichSitePats);
135 int       Likelihood_NY98 (TreeNode *p, int division, int chain, MrBFlt *lnL, int whichSitePats);
136 #if defined (SSE_ENABLED)
137 int       Likelihood_NY98_SSE (TreeNode *p, int division, int chain, MrBFlt *lnL, int whichSitePats);
138 #endif
139 int       Likelihood_Pars (TreeNode *p, int division, int chain, MrBFlt *lnL, int whichSitePats);
140 int       Likelihood_ParsStd (TreeNode *p, int division, int chain, MrBFlt *lnL, int whichSitePats);
141 int       Likelihood_Res (TreeNode *p, int division, int chain, MrBFlt *lnL, int whichSitePats);
142 #if defined (SSE_ENABLED)
143 int       Likelihood_Res_SSE (TreeNode *p, int division, int chain, MrBFlt *lnL, int whichSitePats);
144 #endif
145 int       Likelihood_Std (TreeNode *p, int division, int chain, MrBFlt *lnL, int whichSitePats);
146 int       TiProbs_Fels (TreeNode *p, int division, int chain);
147 int       TiProbs_Gen (TreeNode *p, int division, int chain);
148 int       TiProbs_GenCov (TreeNode *p, int division, int chain);
149 int       TiProbs_Hky (TreeNode *p, int division, int chain);
150 int       TiProbs_JukesCantor (TreeNode *p, int division, int chain);
151 int       TiProbs_Std (TreeNode *p, int division, int chain);
152 int       TiProbs_Res (TreeNode *p, int division, int chain);
153 
154 #endif  /* __LIKELIHOOD_H__ */
155