1 | #include <stdarg.h> |
---|
2 | #include <stdio.h> |
---|
3 | #include <string.h> |
---|
4 | #include <assert.h> |
---|
5 | |
---|
6 | |
---|
7 | typedef struct |
---|
8 | { |
---|
9 | MrBFlt mean; |
---|
10 | MrBFlt median; |
---|
11 | MrBFlt lower; |
---|
12 | MrBFlt upper; |
---|
13 | MrBFlt var; |
---|
14 | MrBFlt PSRF; |
---|
15 | MrBFlt avrESS; |
---|
16 | MrBFlt minESS; |
---|
17 | } |
---|
18 | Stat; |
---|
19 | |
---|
20 | |
---|
21 | int AddBitfield (SafeLong ***list, int listLen, int *set, int setLen); |
---|
22 | #if defined (SSE_ENABLED) |
---|
23 | void AlignedSafeFree(void **ptr); |
---|
24 | #endif |
---|
25 | void ClearBit (int i, SafeLong *bits); |
---|
26 | void ClearBits (SafeLong *bits, int nLongs); |
---|
27 | int CopyResults (FILE *toFile, char *fromFileName, int lastGen); |
---|
28 | int CopyProcessSsFile (FILE *toFile, char *fromFileName, int lastStep, MrBFlt *marginalLnLSS, MrBFlt *splitfreqSS); |
---|
29 | int CopyTreeResults (FILE *toFile, char *fromFileName, int lastGen, int *treeNum); |
---|
30 | int FirstTaxonInPartition (SafeLong *partition, int length); |
---|
31 | SafeLong FirstTree (FILE *fp, char *lineBuf, int longestLine); |
---|
32 | int Flip01 (int x); |
---|
33 | void FlipBits (SafeLong *partition, int length, SafeLong *mask); |
---|
34 | void FlipOneBit (int n, SafeLong *p); |
---|
35 | int FromGrowthFxnToIndex(int *growthFxn); |
---|
36 | void FromIndexToGrowthFxn(int index, int *growthFxn); |
---|
37 | void GetIntSummary (int **vals, int nRows, int *rowCount, Stat *theStats, int HPD); |
---|
38 | int GetKFromGrowthFxn(int *growthFxn); |
---|
39 | void GetSummary (MrBFlt **vals, int nRows, int *rowCount, Stat *theStats, int HPD); |
---|
40 | int HarmonicArithmeticMeanOnLogs (MrBFlt *vals, int nVals, MrBFlt *mean, MrBFlt *harm_mean); |
---|
41 | int IsBitSet (int i, SafeLong *bits); |
---|
42 | int IsConsistentWith (const char *token, const char *expected); |
---|
43 | int IsPartNested (SafeLong *smaller, SafeLong *larger, int length); |
---|
44 | int IsPartCompatible (SafeLong *smaller, SafeLong *larger, int length); |
---|
45 | int IsSectionEmpty (SafeLong *bitField1, SafeLong *bitField2, int length); |
---|
46 | int IsUnionEqThird (SafeLong *bitField1, SafeLong *bitField2, SafeLong *bitField3, int length); |
---|
47 | SafeLong LastBlock (FILE *fp, char *lineBuf, int longestLine); |
---|
48 | int LineTermType (FILE *fp); |
---|
49 | int LongestLine (FILE *fp); |
---|
50 | void LowerUpperMedian (MrBFlt *vals, int nVals, MrBFlt *lower, MrBFlt *upper, MrBFlt *median); |
---|
51 | void LowerUpperMedianHPD (MrBFlt *vals, int nVals, MrBFlt *lower, MrBFlt *upper, MrBFlt *median); |
---|
52 | void MeanVariance (MrBFlt *vals, int nVals, MrBFlt *mean, MrBFlt *var); |
---|
53 | void MeanVarianceLog (MrBFlt *vals, int nVals, MrBFlt *mean, MrBFlt *var, MrBFlt *varEst ); |
---|
54 | int NextTaxonInPartition (int currentTaxon, SafeLong *partition, int length); |
---|
55 | int NumBits (SafeLong *x, int len); |
---|
56 | char *MbPrintNum (MrBFlt num); |
---|
57 | void MrBayesPrint (char *format, ...); |
---|
58 | void MrBayesPrintf (FILE *f, char *format, ...); |
---|
59 | FILE *OpenBinaryFileR (char *name); |
---|
60 | FILE *OpenTextFileA (char *name); |
---|
61 | FILE *OpenTextFileR (char *name); |
---|
62 | FILE *OpenTextFileRQuait (char *name); |
---|
63 | FILE *OpenTextFileW (char *name); |
---|
64 | MrBFlt PotentialScaleReduction (MrBFlt **vals, int nRows, int *count); |
---|
65 | void EstimatedSampleSize (MrBFlt **vals, int nRuns, int *count, MrBFlt *returnESS); |
---|
66 | void *SafeCalloc(size_t n, size_t s); |
---|
67 | int SafeFclose(FILE **fp); |
---|
68 | void SafeFree(void **ptr); |
---|
69 | void *SafeMalloc(size_t s); |
---|
70 | void *SafeRealloc(void *ptr, size_t s); |
---|
71 | char *SafeStrcat(char **target, const char *source); |
---|
72 | char *SafeStrcpy (char **target, const char *source); |
---|
73 | void SetBit (int i, SafeLong *bits); |
---|
74 | void SortInts(int *item, int *assoc, int count, int descendingOrder); |
---|
75 | void SortInts2(int *item, int *assoc, int left, int right, int descendingOrder); |
---|
76 | void SortMrBFlt (MrBFlt *item, int left, int right); |
---|
77 | int StrCmpCaseInsensitive (char *s, char *t); |
---|
78 | void StripComments (char *s); |
---|
79 | FILE *TestOpenTextFileR (char *name); |
---|
80 | void UpdateGrowthFxn(int *growthFxn); |
---|
81 | int UpperTriangIndex(int i, int j, int size); |
---|
82 | int WantTo (const char *msg); |
---|