]> git.donarmstrong.com Git - mrbayes.git/blob - src/likelihood.h
import mrbayes
[mrbayes.git] / src / likelihood.h
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 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        */
45
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);
49 #endif
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);
53 #endif
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);
58 #endif
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);
63 #endif
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);
68 #endif
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);
72 #endif
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);
77 #endif
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);
82 #endif
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);
87 #endif
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);
92 #endif
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);
97 #endif
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);
108 #endif
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);
113 #endif
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);
118 #endif
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);
124 #endif
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);
133
134 #endif  /* __LIKELIHOOD_H__ */