Legofit
infers population history from nucleotide site patterns.
gene.h
1#ifndef ARR_GENE
2#define ARR_GENE
3
4# include "typedefs.h"
5# include "branchtab.h"
6
7struct Gene {
8 tipId_t tipId;
9 struct Gene *parent, *lchild, *rchild;
10 double branch;
11};
12
13Gene *Gene_join(Gene * lchild, Gene * rchild);
14Gene *Gene_new(tipId_t tipId);
15void Gene_tabulate(Gene * self, BranchTab * bt, int doSing);
16void Gene_free(Gene * gene);
17
18static inline void Gene_addToBranch(Gene * gene, double x);
19
20static inline void Gene_addToBranch(Gene * gene, double x) {
21 gene->branch += x;
22}
23
24
25#endif
void Gene_tabulate(Gene *self, BranchTab *bt, int doSing)
Tabulate branch lengths by tipId.
Definition: gene.c:41
Gene * Gene_new(tipId_t tipId)
Constructor for Gene.
Definition: gene.c:19
void Gene_free(Gene *gene)
Destroy a Gene.
Definition: gene.c:68
Gene * Gene_join(Gene *lchild, Gene *rchild)
Create a parental Gene by coalescing two children.
Definition: gene.c:57
Definition: branchtab.c:20
Definition: gene.h:7