Legofit
infers population history from nucleotide site patterns.
Data Structures | Functions
patprob.c File Reference

Calculate site pattern probabilities. More...

#include "patprob.h"
#include "misc.h"
#include "network.h"
#include "branchtab.h"
#include "parse.h"
#include "parstore.h"
#include "binary.h"
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <time.h>
#include <unistd.h>
#include <limits.h>
#include <gsl/gsl_rng.h>

Data Structures

struct  ThreadArg
 Data structure used by each thread. More...
 

Functions

static ThreadArgThreadArg_new (const void *network, unsigned nreps, int doSing)
 Construct a new ThreadArg by copying a template.
 
static void ThreadArg_free (ThreadArg *self)
 ThreadArg destructor.
 
static int tfunc (void *varg, void *tdata)
 function run by each thread
 
BranchTabget_brlen (const void *network, long nreps, int doSing, double min_brlen, gsl_rng *rng)
 Estimate branch lengths. More...
 

Detailed Description

Calculate site pattern probabilities.

Author
Alan R. Rogers

Function Documentation

◆ get_brlen()

BranchTab * get_brlen ( const void *  network,
long  nreps,
int  doSing,
double  min_brlen,
gsl_rng *  rng 
)

Estimate branch lengths.

Function returns a pointer to a newly-allocated object of type BranchTab, which contains all the observed site patterns and their mean branch lengths.

References BranchTab_add(), BranchTab_size(), tfunc(), and ThreadArg_new().

Referenced by costFun().