Legofit
infers population history from nucleotide site patterns.
Functions
strdblqueue.c File Reference

Functions for Composite Likelihood Information Criterion. More...

#include "branchtab.h"
#include "hessian.h"
#include "misc.h"
#include "strdblqueue.h"
#include <math.h>
#include <stdbool.h>
#include <ctype.h>
#include <errno.h>

Functions

static int is_sitepat (const char *s)
 Return 1 if string begins with '#', then any number of whitespace characters, then "SitePat". More...
 
StrDblQueueStrDblQueue_push (StrDblQueue *self, const char *str, double val)
 
StrDblQueueStrDblQueue_pop (StrDblQueue *self, StrDbl *strdbl)
 
int StrDblQueue_length (StrDblQueue *self)
 
StrDblQueueStrDblQueue_free (StrDblQueue *self)
 
void StrDblQueue_print (const StrDblQueue *self, FILE *fp)
 
int StrDblQueue_compare (StrDblQueue *lhs, StrDblQueue *rhs)
 Compare the str fields in two StrDblQueue objects. More...
 
StrDblQueueStrDblQueue_parseLegofit (const char *fname, int freeonly)
 
StrDblQueueStrDblQueue_parseSitePat (const char *fname)
 Parse a data file as produced either by sitepat, tabpat, legosim, or legofit. More...
 
void StrDblQueue_normalize (StrDblQueue *self)
 
double StrDblQueue_msd (const StrDblQueue *a, const StrDblQueue *b)
 
void checkConsistency (const char *fname1, const char *fname2, StrDblQueue *q1, StrDblQueue *q2)
 
void make_covar_matrix (int nfiles, int npar, double array[nfiles][npar], gsl_matrix *cov)
 

Detailed Description

Functions for Composite Likelihood Information Criterion.

Author
Daniel R. Tabin and Alan R. Rogers

Function Documentation

◆ is_sitepat()

static int is_sitepat ( const char *  s)
static

Return 1 if string begins with '#', then any number of whitespace characters, then "SitePat".

Return 0 otherwise.

◆ StrDblQueue_compare()

int StrDblQueue_compare ( StrDblQueue lhs,
StrDblQueue rhs 
)

Compare the str fields in two StrDblQueue objects.

Return -1, 0, or 1 if the lhs is less than, equal to, or greater than rhs.

◆ StrDblQueue_parseSitePat()

StrDblQueue * StrDblQueue_parseSitePat ( const char *  fname)

Parse a data file as produced either by sitepat, tabpat, legosim, or legofit.

Return an object of type StrDblQueue, which contains site pattern names and frequencies.