1 #ifndef __BIRTHDEATH_H__
2 #define __BIRTHDEATH_H__
19 assert(x < matrix->size);
20 assert(y < matrix->size);
51 extern void thread_run(
int numthreads,
void* (*run)(
void*),
void* param,
int size );
struct square_matrix * compute_birthdeath_rates(double branchlength, double lambda, double mu, int maxFamilysize)
Definition: birthdeath.c:238
int maxFamilysize
Definition: birthdeath.h:43
void birthdeath_cache_array_free(pBirthDeathCacheArray pbdc_array)
Definition: birthdeath.c:345
int size
Definition: birthdeath.h:10
void birthdeath_cache_resize(pBirthDeathCacheArray pbdc_array, int remaxFamilysize)
Definition: birthdeath.c:316
Definition: birthdeath.h:8
Definition: birthdeath.h:26
double * values
Definition: birthdeath.h:9
pBirthDeathCacheArray birthdeath_cache_init(int size, struct chooseln_cache *ln_cache)
Definition: birthdeath.c:331
void square_matrix_init(struct square_matrix *matrix, int sz)
Definition: birthdeath.c:121
hash_table_t * table
Definition: birthdeath.h:42
void square_matrix_resize(struct square_matrix *matrix, int new_size)
Definition: birthdeath.c:139
double lambda
Definition: birthdeath.h:29
struct chooseln_cache cache
A cache of values of chooseln.
Definition: birthdeath.c:32
A cache of values of chooseln.
Definition: chooseln_cache.h:16
BirthDeathCacheArray * pBirthDeathCacheArray
Definition: birthdeath.h:45
void square_matrix_set(struct square_matrix *matrix, int x, int y, double val)
Definition: birthdeath.c:127
int branchlength
Definition: birthdeath.h:28
void thread_run(int numthreads, void *(*run)(void *), void *param, int size)
Definition: cafe_main.c:62
struct square_matrix * birthdeath_cache_get_matrix(pBirthDeathCacheArray pbdc_array, double branchlength, double lambda, double mu)
Definition: birthdeath.c:363
A cache of values of family size transition probabilities.
Definition: birthdeath.h:39
std::vector< std::vector< double > > matrix
Definition: branch_cutting.h:11
double birthdeath_rate_with_log_alpha(int s, int c, double log_alpha, double coeff, struct chooseln_cache *cache)
Definition: birthdeath.c:52
a simple hash table implementation
identifies the hashtable for which operations are to be performed
Definition: hashtable.h:64
double birthdeath_likelihood_with_s_c(int s, int c, double branchlength, double lambda, double mu, struct chooseln_cache *cache)
Calculates the probability of transitioning from root_family_size to family_size. ...
Definition: birthdeath.c:79
void square_matrix_multiply(struct square_matrix *matrix, double *vector, int row_start, int row_end, int col_start, int col_end, double *result)
Definition: birthdeath.c:163
double mu
Definition: birthdeath.h:30