Legofit
infers population history from nucleotide site patterns.
strdblqueue.h
1#ifndef STR_DBL_QUEUE
2#define STR_DBL_QUEUE
3
4#include "lblndx.h"
5#include <stdio.h>
6#include <stdlib.h>
7#include <assert.h>
8#include <string.h>
9#include <math.h>
10#include <gsl/gsl_matrix.h>
11#include <gsl/gsl_blas.h>
12
13typedef struct StrDbl StrDbl;
14
15struct StrDbl {
16 char str[100];
17 double val;
18};
19
20// A FIFO queue. New values are pushed onto the tail. Old ones are
21// popped off of the head.
23 struct StrDblQueue *next;
24 struct StrDbl strdbl;
25};
26
27StrDblQueue *StrDblQueue_push(StrDblQueue *prev, const char *str, double val);
28StrDblQueue *StrDblQueue_pop(StrDblQueue *self, StrDbl *strdbl);
29StrDblQueue *StrDblQueue_free(StrDblQueue *self);
30int StrDblQueue_length(StrDblQueue *self);
31void StrDblQueue_print(const StrDblQueue *self, FILE *fp);
33// StrDbl *StrDblQueue_get(StrDblQueue *self, StrDbl *strdbl, int index);
34StrDblQueue *StrDblQueue_parseLegofit(const char *fname, int freeonly);
35StrDblQueue *StrDblQueue_parseSitePat(const char *fname);
36double StrDblQueue_msd(const StrDblQueue *a, const StrDblQueue *b);
37void StrDblQueue_normalize(StrDblQueue *self);
38void checkConsistency(const char *fname1, const char *fname2,
39 StrDblQueue *q1, StrDblQueue *q2);
40void make_covar_matrix(int nfiles, int npar, double array[nfiles][npar],
41 gsl_matrix *cov);
42
43#endif
int StrDblQueue_compare(StrDblQueue *lhs, StrDblQueue *rhs)
Compare the str fields in two StrDblQueue objects.
Definition: strdblqueue.c:90
StrDblQueue * StrDblQueue_parseSitePat(const char *fname)
Parse a data file as produced either by sitepat, tabpat, legosim, or legofit.
Definition: strdblqueue.c:193
Definition: strdblqueue.h:15
Definition: strdblqueue.h:22