Legofit
infers population history from nucleotide site patterns.
Loading...
Searching...
No Matches
sitepat.c File Reference
#include "binary.h"
#include "boot.h"
#include "rafreader.h"
#include "longvec.h"
#include "misc.h"
#include "strint.h"
#include "error.h"
#include "typedefs.h"
#include <ctype.h>
#include <errno.h>
#include <getopt.h>
#include <gsl/gsl_rng.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

Data Structures

struct  Stack
 Treat a vector of tipId_t values as a push-down stack. More...

Functions

static void usage (void)
 Print usage message and die.
static StackStack_new (int dim, tipId_t buff[dim])
 This stack is local to this file.
static void Stack_free (Stack *stk)
 Frees the stack but not the underlying buffer.
static void Stack_push (Stack *self, tipId_t x)
 Add an entry to the stack, checking bounds.
static void generatePatterns (int bit, int npops, Stack *stk, tipId_t pat, int doSing)
 Call as generatePatterns(0, npops, stk, 0); Recursive function, which generates all legal site patterns and pushes them onto a stack.
int main (int argc, char **argv)

Variables

const char * useMsg

Function Documentation

◆ Stack_new()

Stack * Stack_new ( int dim,
tipId_t buff[dim] )
static

This stack is local to this file.

It provides a bounds-controlled interface to an external array, which is passed as an argument, buff, to Stack_new.

Variable Documentation

◆ useMsg

const char* useMsg
Initial value:
=
"\nUsage: sitepat [options] <x>=<in_1> <y>=<in_2> ... outgroup=<in_K>\n"
" where <x> and <y> are arbitrary labels, and <in_i> are input\n"
" files in raf format. Labels may not include the character \":\".\n"
" Final label must be \"outgroup\". Writes to standard output.\n"
"\n"
" If input file name ends with .gz, input is decompressed using\n"
" gunzip.\n"