75#define uniform(a,b) ( a + (b - a) * xsh_dr250() )
83#define PI 3.1415626536
94 double *
x, *xnew, *xbest;
95 float dt,
c_jump, K, rho, t0, tscale, range;
112 float ynew, c, delta, tmpval;
117 for (i = 0; i <
n; i++)
142 delta = (
s.
y != 0.0 ) ? delta /
s.
y : ( ynew != 0.0 ) ?
143 delta / ynew : delta;
210 if ( (
s.
x = (
double *)cpl_malloc( space )) == NULL )
212 if ( (
s.
xnew = (
double *)cpl_malloc( space )) == NULL )
214 if ( (
s.
xbest = (
double *)cpl_malloc( space )) == NULL )
379 float ynew, t, cold = 0.0, c = 0.0, tmpval;
387 for (i = 0; i <
n; i++)
389 if (i > 0 && c > 0.0)
409 if ( c < 0.0 && ynew <
s.
ybest)
418 if ( ok && c > (
s.
c_jump * cold) )
435 float p, ynew, t=0.0, c, dt, told, tmpval;
446 for (i = 0; i <
n; i++)
483 p = exp( - (ynew -
s.
y) / (
s.
K * t) );
float xsh_SAanneal(int iters)
void xsh_SAinitial(double *xi)
void xsh_SAoptimum(double *xb)
static int equilibrate(float t, int n)
void xsh_SAcurrent(double *xc)
float xsh_SABoltzmann(float k)
float xsh_SAmelt(int iters)
float xsh_SAtemperature(float t)
void xsh_r250_init(int sd)
float xsh_SAjump(float j)
int xsh_SAiterations(int m)
float xsh_SArange(float r)
float xsh_SAlearning_rate(float r)
int xsh_SAInit(CostFunction f, int d)
float(* CostFunction)(double *)