ARB
Main Page
Namespaces
Classes
Files
File List
File Members
TOOLS
DNAml_rates_1_0.h
Go to the documentation of this file.
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
#ifndef CXXFORWARD_H
9
#include <
cxxforward.h
>
10
#endif
11
#ifndef ARBDBT_H
12
#include <
arbdbt.h
>
13
#endif
14
15
#define Debug 1
16
17
// Program constants and parameters
18
19
#define maxsp 10000 // maximum number of species
20
#define maxsites 8000 // maximum number of sites
21
#define maxpatterns 8000 // max number of different site patterns
22
#define maxcategories 35 // maximum number of site types
23
#define nmlngth 10 // max. number of characters in species name
24
#define KI_MAX 256.0 // largest rate possible
25
#define RATE_STEP sqrt(sqrt(2.0)) // initial step size for rate search
26
#define MAX_ERROR 0.01 // max fractional error in rate calculation
27
#define MIN_INFO 4 // minimum number of informative sequences
28
#define UNDEF_CATEGORY 1 // category number to output for undefined rate
29
#define zmin 1.0E-15 // max branch prop. to -log(zmin) (= 34)
30
#define zmax (1.0 - 1.0E-6) // min branch prop. to 1.0-zmax (= 1.0E-6)
31
#define unlikely -1.0E300 // low likelihood for initialization
32
#define decimal_point '.'
33
34
// the following macros are already defined in gmacros.h:
35
// #define ABS(x) (((x)< 0) ? -(x) : (x))
36
// #define MIN(x, y) (((x)<(y)) ? (x) : (y))
37
// #define MAX(x, y) (((x)>(y)) ? (x) : (y))
38
#define LOG(x) (((x)> 0) ? log(x) : hang("log domain error"))
39
#define nint(x) ((int) ((x)>0 ? ((x)+0.5) : ((x)-0.5)))
40
#define aint(x) ((double) ((int) (x)))
41
42
43
typedef
double
xtype
;
44
struct
node
;
45
typedef
node
*
nodeptr
;
46
47
#if defined(Cxx11)
48
CONSTEXPR
int
MAXNODES
=
leafs_2_nodes
(
maxsp
,
ROOTED
);
49
#else // !defined(Cxx11)
50
const
int
MAXNODES
= 2*
maxsp
+1;
51
#endif
52
53
struct
xarray
{
54
xarray
*
prev
;
55
xarray
*
next
;
56
nodeptr
owner
;
57
xtype
*
a
, *
c
, *
g
, *
t
;
58
};
59
60
struct
node
{
61
double
z
;
62
nodeptr
next
;
63
nodeptr
back
;
64
int
number
;
65
xarray
*
x
;
66
int
xcoord
,
ycoord
,
ymin
,
ymax
;
67
char
name
[
nmlngth
+1];
// Space for null termination
68
char
*
tip
;
// Pointer to sequence data
69
};
70
71
72
struct
tree
{
73
double
likelihood
;
74
double
log_f
[
maxpatterns
];
75
nodeptr
nodep
[
MAXNODES
];
76
nodeptr
start
;
77
int
mxtips
;
78
int
ntips
;
79
int
nextnode
;
80
int
opt_level
;
81
bool
smoothed
;
82
bool
rooted
;
83
};
84
85
struct
drawdata
{
86
double
tipmax
;
87
int
tipy
;
88
};
89
90
91
92
node::number
int number
Definition:
DNAml_rates_1_0.h:64
ROOTED
Definition:
arbdbt.h:48
tree::likelihood
double likelihood
Definition:
DNAml_rates_1_0.h:73
node
Definition:
DNAml_rates_1_0.h:60
node::z
double z
Definition:
DNAml_rates_1_0.h:61
node::back
nodeptr back
Definition:
DNAml_rates_1_0.h:63
node::ymax
int ymax
Definition:
DNAml_rates_1_0.h:66
drawdata::tipy
int tipy
Definition:
DNAml_rates_1_0.h:87
node::name
char name[nmlngth+1]
Definition:
DNAml_rates_1_0.h:67
xarray
Definition:
DNAml_rates_1_0.h:53
xarray::t
xtype * t
Definition:
DNAml_rates_1_0.h:57
xtype
double xtype
Definition:
DNAml_rates_1_0.h:43
node::xcoord
int xcoord
Definition:
DNAml_rates_1_0.h:66
maxsp
#define maxsp
Definition:
DNAml_rates_1_0.h:19
xarray::next
xarray * next
Definition:
DNAml_rates_1_0.h:55
node::x
xarray * x
Definition:
DNAml_rates_1_0.h:65
tree::nodep
nodeptr nodep[MAXNODES]
Definition:
DNAml_rates_1_0.h:75
tree::mxtips
int mxtips
Definition:
DNAml_rates_1_0.h:77
leafs_2_nodes
CONSTEXPR_INLINE int leafs_2_nodes(int leafs, TreeModel model)
Definition:
arbdbt.h:53
cxxforward.h
node::tip
char * tip
Definition:
DNAml_rates_1_0.h:68
tree::rooted
bool rooted
Definition:
DNAml_rates_1_0.h:82
tree
Definition:
DNAml_rates_1_0.h:72
tree::smoothed
bool smoothed
Definition:
DNAml_rates_1_0.h:81
nodeptr
node * nodeptr
Definition:
DNAml_rates_1_0.h:44
xarray::prev
xarray * prev
Definition:
DNAml_rates_1_0.h:54
MAXNODES
const int MAXNODES
Definition:
DNAml_rates_1_0.h:50
tree::opt_level
int opt_level
Definition:
DNAml_rates_1_0.h:80
arbdbt.h
xarray::owner
nodeptr owner
Definition:
DNAml_rates_1_0.h:56
tree::ntips
int ntips
Definition:
DNAml_rates_1_0.h:78
xarray::g
xtype * g
Definition:
DNAml_rates_1_0.h:57
xarray::a
xtype * a
Definition:
DNAml_rates_1_0.h:57
node::ymin
int ymin
Definition:
DNAml_rates_1_0.h:66
xarray::c
xtype * c
Definition:
DNAml_rates_1_0.h:57
drawdata::tipmax
double tipmax
Definition:
DNAml_rates_1_0.h:86
node::next
nodeptr next
Definition:
DNAml_rates_1_0.h:62
tree::start
nodeptr start
Definition:
DNAml_rates_1_0.h:76
tree::nextnode
int nextnode
Definition:
DNAml_rates_1_0.h:79
tree::log_f
double log_f[maxpatterns]
Definition:
DNAml_rates_1_0.h:74
drawdata
Definition:
DNAml_rates_1_0.h:85
maxpatterns
#define maxpatterns
Definition:
DNAml_rates_1_0.h:21
CONSTEXPR
#define CONSTEXPR
Definition:
cxxforward.h:108
nmlngth
#define nmlngth
Definition:
DNAml_rates_1_0.h:23
node::ycoord
int ycoord
Definition:
DNAml_rates_1_0.h:66
Generated by
1.8.8