Legofit
infers population history from nucleotide site patterns.
parstore.h
1#ifndef ARR_PARSTORE_H
2# define ARR_PARSTORE_H
3
4# include "typedefs.h"
5# include "misc.h"
6# include "ptrqueue.h"
7# include <gsl/gsl_rng.h>
8# define MAXPAR 100
9
10struct Bounds {
11 double lo_twoN, hi_twoN, lo_t, hi_t;
12};
13
14int Bounds_equals(const Bounds * lhs, const Bounds * rhs);
15void Bounds_sanityCheck(Bounds * self, const char *file, int line);
16
17ParStore *ParStore_dup(const ParStore * old);
18ParStore *ParStore_new(PtrQueue *fixedQ, PtrQueue *freeQ,
19 PtrQueue *constrQ);
20Param *ParStore_getParam(ParStore *self, int i);
21const char *ParStore_getNameFree(ParStore * self, int i);
22double ParStore_getVal(ParStore *self, int i);
23int ParStore_equals(ParStore * lhs, ParStore * rhs);
24int ParStore_getIndex(ParStore * self, const char *name);
26int ParStore_nFixed(ParStore * self);
27int ParStore_nFree(ParStore * self);
28int ParStore_nPar(ParStore *self);
29int ParStore_setFreeParams(ParStore * self, int n, double x[n]);
30void ParStore_free(ParStore * self);
31void ParStore_getFreeParams(ParStore * self, int n, double x[n]);
32void ParStore_print(ParStore * self, FILE * fp);
33void ParStore_printConstrained(ParStore * self, FILE * fp);
34void ParStore_printFree(ParStore * self, FILE * fp);
35void ParStore_sanityCheck(ParStore * self, const char *file, int line);
36
37#endif
int ParStore_nFixed(ParStore *self)
Return the number of fixed parameters.
Definition: parstore.c:263
int Bounds_equals(const Bounds *lhs, const Bounds *rhs)
Return 1 if two Bounds objects are equal; 0 otherwise.
Definition: parstore.c:504
int ParStore_getIndex(ParStore *self, const char *name)
Return index of parameter name, or -1 if the name isn't there.
Definition: parstore.c:353
void ParStore_printFree(ParStore *self, FILE *fp)
Print free parameter values.
Definition: parstore.c:307
int ParStore_setFreeParams(ParStore *self, int n, double x[n])
Set vector of free parameters, then update constrained parameters.
Definition: parstore.c:276
void ParStore_print(ParStore *self, FILE *fp)
Print a ParStore.
Definition: parstore.c:293
const char * ParStore_getNameFree(ParStore *self, int i)
Get name of i'th free parameter.
Definition: parstore.c:346
int ParStore_equals(ParStore *lhs, ParStore *rhs)
Return 1 if two ParStore objects are equal; 0 otherwise.
Definition: parstore.c:401
void ParStore_getFreeParams(ParStore *self, int n, double x[n])
Get vector of free parameters.
Definition: parstore.c:285
void Bounds_sanityCheck(Bounds *self, const char *file, int line)
Make sure Bounds object is sane.
Definition: parstore.c:493
int ParStore_nFree(ParStore *self)
Return the number of free parameters.
Definition: parstore.c:257
int ParStore_nConstrained(ParStore *self)
Return the number of constrained parameters.
Definition: parstore.c:269
int ParStore_nPar(ParStore *self)
Return the number of parameters.
Definition: parstore.c:239
ParStore * ParStore_dup(const ParStore *old)
Duplicate a ParStore.
Definition: parstore.c:183
void ParStore_printConstrained(ParStore *self, FILE *fp)
Print constrained parameter values.
Definition: parstore.c:319
void ParStore_free(ParStore *self)
Destructor.
Definition: parstore.c:331
Definition: parstore.h:10
Definition: parstore.c:42
Definition: param.h:12
Definition: ptrqueue.c:23