This function performs a simulated annealing search through a given space. The space is specified by providing the functions Ef and distance. The simulated annealing steps are generated using the random number generator r and the function take_step.
The starting configuration of the system should be given by x0_p.
The routine offers two modes for updating configurations, a fixed-size
mode and a variable-size mode. In the fixed-size mode the configuration
is stored as a single block of memory of size element_size.
Copies of this configuration are created, copied and destroyed
internally using the standard library functions malloc
,
memcpy
and free
. The function pointers copyfunc,
copy_constructor and destructor should be null pointers in
fixed-size mode. In the variable-size mode the functions
copyfunc, copy_constructor and destructor are used to
create, copy and destroy configurations internally. The variable
element_size should be zero in the variable-size mode.
The params structure (described below) controls the run by providing the temperature schedule and other tunable parameters to the algorithm.
On exit the best result achieved during the search is placed in
*x0_p
. If the annealing process has been successful this
should be a good approximation to the optimal point in the space.
If the function pointer print_position is not null, a debugging
log will be printed to stdout
with the following columns:
number_of_iterations temperature x x-(*x0_p) Ef(x)
and the output of the function print_position itself. If print_position is null then no information is printed.
double (*gsl_siman_Efunc_t) (void *xp)
void (*gsl_siman_step_t) (const gsl_rng *r, void *xp, double step_size)
double (*gsl_siman_metric_t) (void *xp, void *yp)
void (*gsl_siman_print_t) (void *xp)
void (*gsl_siman_copy_t) (void *source, void *dest)
void * (*gsl_siman_copy_construct_t) (void *xp)
void (*gsl_siman_destroy_t) (void *xp)
gsl_siman_solve
.
This structure contains all the information needed to control the
search, beyond the energy function, the step function and the initial
guess.
int n_tries
int iters_fixed_T
double step_size
double k, t_initial, mu_t, t_min