-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrandom.h
More file actions
executable file
·51 lines (41 loc) · 2.43 KB
/
random.h
File metadata and controls
executable file
·51 lines (41 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
GenRan: Non-Gaussian random field generator.
Copyright (C) 2006 Peter Grassl
Distributed under the MIT licence.
Public declarations of all functions used across translation units. The
function bodies live in their respective .C files (see README).
*/
// --- Statistics and the random number generator ------------------------------
void moment(double data[], int n, double *ave, double *adev, double *sdev,
double *var, double *skew, double *curt);
double ran1(long *idum);
double gammaln(double xx);
// --- Field generation --------------------------------------------------------
void generateGaussianField(double gaussianField[], double spectralDensityFunction[],
int numberReal[], double autoLength[], double sDeviation,
long randomInteger, int nDim);
void computeTargetSpectralDensity(double spectralDensityFunction[], int numberReal[],
double autoLength[], double variance, int nDim);
void generateRandomField(double field[], int numberReal[], double autoLength[],
double parameter[], int nDim, int typeOfCDF,
long randomInteger, int padding = 1,
int iterate = 0, int iterMaxIter = 100,
double iterTolerance = 0.01, double iterBeta = 1.4,
int iterHermiteOrder = 30);
void mapGaussianToRandom(double field[], int numberReal[], double randomParameter[],
int nDim, int typeOfCDF, double gaussianStdOverride = -1.0);
// --- FFT (Cooley-Tukey, 1-based interface) -----------------------------------
void four1(double data[], int nn, int isign);
// --- Distribution helpers ----------------------------------------------------
double normal_01_cdf(double x);
double normal_01_cdf_inv(double p);
double normal_cdf(double x, double a, double b);
double normal_cdf_inv(double cdf, double a, double b);
double dpoly_value(int n, double a[], double x);
double computeRescaling(double graftedParameter[], double &gaussianMean,
double &gaussianSDV);
// --- Input file parsing ------------------------------------------------------
int getint_ini(const char *fname, const char *lhs);
double getdouble_ini(const char *fname, const char *lhs);
bool tryGetint_ini(const char *fname, const char *lhs, int *out);
bool tryGetdouble_ini(const char *fname, const char *lhs, double *out);