17 #define debug 1 // 0=NO, 1=OPTn, >1=ALL 32 double p = exp(6.0 * (eps - 1.0));
41 for (
int i = 0; i < p.
size(); i++) {
42 double range = p[i].Range();
43 double delta = range * (
Random() - 0.5) * eps;
60 for (
int temp = MAXT; temp > 0; temp--) {
62 double eps = temp / double (MAXT);
66 double new_x = f(new_p);
67 #if debug>1 // ALL points 68 Print(
"%g %g %.12g\n", new_p[
"d"].Value(), new_p[
"k"].Value(), new_x);
77 Print(
"# %shil step accepted: ", bad ?
"up" :
"down");
78 Print(
"%g %g %.12g\n", new_p[
"d"].Value(), new_p[
"k"].Value(),
85 #if debug==1 // optima only 86 Print(
"%g %g %.12g\n", p[
"d"].Value(), p[
"k"].Value(), opt);
91 Print(
"# %d accepted uphill steps\n", bad_count);
double Random()
base uniform generator (range 0-0.999999...) the default implementation is simple LCG 32bit ...
double Optimize_simann(double(*f)(const ParameterVector &p), ParameterVector &p, int MAXT)
bool accept_bad(double eps)
int Print(const char *fmt,...)
for Output methods, can be redirected
Implementation of class CalendarList interface is static - using global functions in SQS namespace...
void move_to_next_point(ParameterVector &p, double eps)
Basic optimization framework + methods.
Internal header file for SIMLIB/C++.
Main SIMLIB/C++ interface.