Legofit
infers population history from nucleotide site patterns.
Functions
cost.c File Reference
#include "dprintf.h"
#include "branchtab.h"
#include "cost.h"
#include "misc.h"
#include "network.h"
#include "patprob.h"
#include "simsched.h"
#include <gsl/gsl_rng.h>
#include <math.h>

Functions

double costFun (int dim, double x[dim], void *jdata, void *tdata)
 Calculate cost. More...
 
void * CostPar_dup (const void *arg)
 Duplicate an object of class CostPar.
 
void CostPar_free (void *arg)
 CostPar destructor.
 

Function Documentation

◆ costFun()

double costFun ( int  dim,
double  x[dim],
void *  jdata,
void *  tdata 
)

Calculate cost.

Parameters
[in]dimdimension of x
[in]xvector of parameter values.
jdatavoid pointer to a CostPar object, which contains exogeneous parameters of the cost function.
tdatavoid pointer to a random number generator
Returns
cost

References BranchTab_free(), BranchTab_KLdiverg(), BranchTab_negLnL(), BranchTab_normalize(), get_brlen(), and SimSched_getSimReps().