#include <gsl_anneal.h>
This class is a modification of simulated annealing as implemented in GSL in the function gsl_siman_solve()
. It acts as a generic multidimensional minimizer for any function given a generic temperature schedule specified by the user.
The simulated annealing algorithm proposes a displacement of one coordinate of the previous point by
where the are random numbers between 0 and 1. The displacement is accepted or rejected based on the Metropolis method. The random number generator and temperature schedule are set in the parent, sim_anneal. The variables multi_min::tolx and multi_min::tolf are not used.
The step size for each dimension is specified in set_stepsize(). The number of stepsizes specified need not be the same as the number of dimensions. If nstep
is the number of stepsizes, then the stepsize for dimension i
is
step_size[i % nstep]
Definition at line 77 of file gsl_anneal.h.
Public Member Functions | |
virtual int | mmin (size_t nvar, vec_t &x0, double &fmin, param_t &pa, func_t &func) |
Calculate the minimum fmin of func w.r.t the array x0 of size nvar . | |
virtual const char * | type () |
Return string denoting type ("gsl_anneal"). | |
template<class vec2_t> | |
int | set_stepsize (size_t n, vec2_t &ss) |
Set the step. | |
Data Fields | |
double | boltz |
Boltzmann factor (default 1.0). | |
Protected Member Functions | |
virtual int | allocate (size_t n, double boltz_factor=1.0) |
Allocate memory for a minimizer over n dimensions with stepsize step and Boltzmann factor boltz_factor . | |
virtual int | free () |
Free allocated memory. | |
virtual int | step (vec_t &sx, int nvar) |
Make a step to a new attempted minimum. | |
Protected Attributes | |
alloc_t | ao |
Allocation object. | |
size_t | nstep |
Number of step sizes. | |
double * | step_sizes |
Step sizes. | |
Storage for present, next, and best vectors | |
alloc_vec_t | x |
alloc_vec_t | new_x |
alloc_vec_t | best_x |
Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.
Project hosting provided by
,
O2scl Sourceforge Project Page