1 | /* DNAml_rates.h */ |
---|
2 | |
---|
3 | /* Compile time switches for various updates to program: |
---|
4 | * 0 gives original version |
---|
5 | * 1 gives new version |
---|
6 | */ |
---|
7 | |
---|
8 | #define UseStdin 1 |
---|
9 | #define Debug 1 |
---|
10 | #define DebugData 0 |
---|
11 | |
---|
12 | /* Program constants and parameters */ |
---|
13 | |
---|
14 | #define maxsp 10000 /* maximum number of species */ |
---|
15 | #define maxsites 8000 /* maximum number of sites */ |
---|
16 | #define maxpatterns 8000 /* max number of different site patterns */ |
---|
17 | #define maxcategories 35 /* maximum number of site types */ |
---|
18 | #define nmlngth 10 /* max. number of characters in species name */ |
---|
19 | #define KI_MAX 256.0 /* largest rate possible */ |
---|
20 | #define RATE_STEP sqrt(sqrt(2.0)) /* initial step size for rate search */ |
---|
21 | #define MAX_ERROR 0.01 /* max fractional error in rate calculation */ |
---|
22 | #define MIN_INFO 4 /* minimum number of informative sequences */ |
---|
23 | #define UNDEF_CATEGORY 1 /* category number to output for undefined rate */ |
---|
24 | #define zmin 1.0E-15 /* max branch prop. to -log(zmin) (= 34) */ |
---|
25 | #define zmax (1.0 - 1.0E-6) /* min branch prop. to 1.0-zmax (= 1.0E-6) */ |
---|
26 | #define unlikely -1.0E300 /* low likelihood for initialization */ |
---|
27 | #define decimal_point '.' |
---|
28 | |
---|
29 | #define TRUE 1 |
---|
30 | #define FALSE 0 |
---|
31 | |
---|
32 | #define ABS(x) (((x)< 0) ? -(x) : (x)) |
---|
33 | #define MIN(x,y) (((x)<(y)) ? (x) : (y)) |
---|
34 | #define MAX(x,y) (((x)>(y)) ? (x) : (y)) |
---|
35 | #define LOG(x) (((x)> 0) ? log(x) : hang("log domain error")) |
---|
36 | #define nint(x) ((int) ((x)>0 ? ((x)+0.5) : ((x)-0.5))) |
---|
37 | #define aint(x) ((double) ((int) (x))) |
---|
38 | |
---|
39 | |
---|
40 | typedef int boolean; |
---|
41 | |
---|
42 | typedef double xtype; |
---|
43 | |
---|
44 | typedef struct xmantyp { |
---|
45 | struct xmantyp *prev; |
---|
46 | struct xmantyp *next; |
---|
47 | struct noderec *owner; |
---|
48 | xtype *a, *c, *g, *t; |
---|
49 | } xarray; |
---|
50 | |
---|
51 | typedef struct noderec { |
---|
52 | double z; |
---|
53 | struct noderec *next; |
---|
54 | struct noderec *back; |
---|
55 | int number; |
---|
56 | xarray *x; |
---|
57 | int xcoord, ycoord, ymin, ymax; |
---|
58 | char name[nmlngth+1]; /* Space for null termination */ |
---|
59 | char *tip; /* Pointer to sequence data */ |
---|
60 | } node, *nodeptr; |
---|
61 | |
---|
62 | typedef struct { |
---|
63 | double likelihood; |
---|
64 | double log_f[maxpatterns]; |
---|
65 | node *nodep[2*maxsp-1]; |
---|
66 | node *start; |
---|
67 | int mxtips; |
---|
68 | int ntips; |
---|
69 | int nextnode; |
---|
70 | int opt_level; |
---|
71 | boolean smoothed; |
---|
72 | boolean rooted; |
---|
73 | } tree; |
---|
74 | |
---|
75 | typedef struct { |
---|
76 | double tipmax; |
---|
77 | int tipy; |
---|
78 | } drawdata; |
---|
79 | |
---|
80 | |
---|
81 | |
---|
82 | |
---|