Legofit
infers population history from nucleotide site patterns.
eventlst.h
1#ifndef ARR_EVENTLST
2#define ARR_EVENTLST
3
4#include "typedefs.h"
5#include <stdio.h>
6#include <stdint.h>
7
33struct EventLst {
34 long unsigned event; // which episode of migration?
35 long unsigned outcome; // outcome of this event
36 long double pr; // probability of this outcome
37 struct EventLst *next;
38};
39
40unsigned nextEvent(void);
41EventLst *EventLst_insert(EventLst *head,
42 long unsigned event,
43 long unsigned outcome,
44 long double pr);
45EventLst *EventLst_dup(EventLst *old);
46void EventLst_free(EventLst *self);
47void EventLst_print(EventLst *self, FILE *fp);
48EventLst *EventLst_join(EventLst *left, EventLst *right,
49 int *mutually_exclusive);
50long double EventLst_prob(EventLst *head);
51int EventLst_cmp(const EventLst *left, const EventLst *right);
52#ifdef __clang__
53uint32_t EventLst_hash(const EventLst *self)
54 __attribute__((no_sanitize("integer")));
55#else
56uint32_t EventLst_hash(const EventLst *self);
57#endif
58void EventLst_sanityCheck(const EventLst *self,
59 const char *file, int lineno);
60
61#endif
This structure handles bookkeeping associated with events of two types: (1) partitions of the set of ...
Definition: eventlst.h:33