DFNgen  2.0
DFN Model Generator
mathFunctions.h
Go to the documentation of this file.
1 #ifndef _MATHFUNCTIONS_H_
2 #define _MATHFUNCTIONS_H_
3 
4 double sumDeviation(const double *data, int n);
5 double *sumDevAry3(double *data);
6 int maxElmtIdx(double *data, int n);
7 int *sortedIndex(const double *arr, int n);
8 double getArea(struct Poly &poly);
9 int indexFromProb(float *CDF, double roll, int size);
10 int indexFromProb_and_P32Status(float *CDF, double roll, int famSize, int cdfSize, int &cdfIdx);
11 void adjustCDF_and_famProb(float *&CDF, float *&famProbability, int &cdfSize, int idx2Remove);
12 float *createCDF(float *famProb, int size);
13 float truncatedPowerLaw(float randomNum, float emin, float emax, float alpha);
14 int cdfIdxFromFamNum(float *CDF, bool *p32Status, int famIdx);
15 
16 /****************************************************/
24 inline void OR(bool *dest, bool *src){
25  dest[0] = (dest[0] | src[0]);
26  dest[1] = (dest[1] | src[1]);
27  dest[2] = (dest[2] | src[2]);
28  dest[3] = (dest[3] | src[3]);
29  dest[4] = (dest[4] | src[4]);
30  dest[5] = (dest[5] | src[5]);
31 }
32 
33 #endif
double sumDeviation(const double *data, int n)
float * createCDF(float *famProb, int size)
double * sumDevAry3(double *data)
float * emin
Definition: readInput.cpp:222
int maxElmtIdx(double *data, int n)
float * emax
Definition: readInput.cpp:225
int indexFromProb_and_P32Status(float *CDF, double roll, int famSize, int cdfSize, int &cdfIdx)
int * sortedIndex(const double *arr, int n)
void OR(bool *dest, bool *src)
Definition: mathFunctions.h:24
float truncatedPowerLaw(float randomNum, float emin, float emax, float alpha)
void adjustCDF_and_famProb(float *&CDF, float *&famProbability, int &cdfSize, int idx2Remove)
float * famProb
Definition: readInput.cpp:133
bool * p32Status
Definition: readInput.cpp:468
int cdfIdxFromFamNum(float *CDF, bool *p32Status, int famIdx)
int indexFromProb(float *CDF, double roll, int size)
double getArea(struct Poly &poly)