-
Notifications
You must be signed in to change notification settings - Fork 0
/
commonFunctions.h
31 lines (26 loc) · 1.43 KB
/
commonFunctions.h
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
/** \class commonFunctions
* \brief This class contains all the common function of the system
*
* This class contains all the functions useful in general
* \authors alessandro filisetti
* \date 2011/12/10
* \version 1.0
*/
#ifndef COMMONFUNCTIONS
#define COMMONFUNCTIONS
#include "acs_headers.h"
//FUNCTIONS
acs_longInt returnSelectionIdFromAWeightProbVector(acs_double *tmpArray, MTRand& tmpRandomGenerator, acs_int tmpRow = 0);
acs_longInt returnSelectionIdFromAWeightProbVector(vector<acs_double>& tmpVector, acs_double tmpMaxValue, MTRand& tmpRandomGenerator, acs_int tmpRow = 0);
acs_longInt returnSelectionIdFromAWeightProbVectorAlreadyNormalized(vector<acs_double>& tmpVector, MTRand& tmpRandomGenerator);
acs_longInt returnUniformSelection_LONG_IdFromVector(vector<acs_longInt>& tmpVector, MTRand& tmpRandomGenerator);
acs_longInt getIntRandom(acs_longInt tmpFromNum, acs_longInt tmpToNum, MTRand& tmpRandomGenerator);
acs_double getDoubleRandom(acs_double tmpFromNum, acs_double tmpToNum, MTRand& tmpRandomGenerator);
acs_longInt random_poisson(acs_double tmpLambda, MTRand& tmpRandomGenerator);
acs_longInt random_binomial(acs_longInt n, acs_double tmpP, MTRand& tmpRandomGenerator);
acs_double acsround(acs_double tmpX, MTRand& tmprnd);
string dec2bin(acs_int tmpInt);
vector<string> split(string str,const char* delim);
bool ExitWithError(string strFunctionName, string strError);
bool fromStrToBool(string const &string);
#endif