29 const float INF = 1e20;
34 return (x <= LogP_zero / 2) ? 0 : exp((
double)(x));
37 return ((x) <= 0) ? LogP_zero : log((
double)(x));
50 for (
int i = 0; i < num; i++) {
74 double dRand(
double dmin,
double dmax);
80 void EasySmooth(Prob *p,
int num, Prob threshold = 1e-5);
LogP Log_Sub(LogP x, LogP y)
log[exp(x)-exp(y)]
int LogLineSampling(const LogP *pdProbs, int nNum)
void RandomPos(int *a, int len, int n)
double SigmFunc(double x)
calculate the sigmoid function f(x) = 1/(1+exp(-x))
void LineNormalize(Prob *pdProbs, int nNum)
double dRand(double dmin, double dmax)
get a random float between dmin and dmax
int LineSampling(const Prob *pdProbs, int nNum)
bool Acceptable(Prob prob)
int omp_rand(int thread_num)
void EasySmooth(Prob *p, int num, Prob threshold)
smooth a distribution
LogP LogLineNormalize(LogP *pdProbs, int nNum)
double GetAISFactor(int t, int T)
Get the AIS intermediate factor beta_t.
LogP Log_Sum(LogP *p, int num)
log summate all the values in array
int omp_nrand(int nMin, int nMax)
get a random integer int [nMin, nMax-1]
include all the wb-written modules
define all the code written by Bin Wang.