Object-oriented Scientific Computing Library: Version 0.910
Public Member Functions | Data Fields
sim_anneal< func_t, vec_t, rng_t > Class Template Reference

Simulated annealing base. More...

#include <sim_anneal.h>

Inheritance diagram for sim_anneal< func_t, vec_t, rng_t >:
multi_min< func_t, dfunc_t, vec_t > gsl_anneal< func_t, vec_t, alloc_vec_t, alloc_t, rng_t >

Detailed Description

template<class func_t = multi_funct, class vec_t = ovector_base, class rng_t = gsl_rnga>
class sim_anneal< func_t, vec_t, rng_t >

The seed of the generator is not fixed initially by calls to mmin(), so if successive calls should reproduce the same results, then the random seed should be set by the user before each call.

For the algorithms here, it is important that all of the inputs x[i] to the function are scaled similarly relative to the temperature. For example, if the inputs x[i] are all of order 1, one might consider a temperature schedule which begins with $ T=1 $ .

The number of iterations at each temperature is controlled by multi_min::ntrial which defaults to 100.

Definition at line 55 of file sim_anneal.h.

Public Member Functions

virtual int mmin (size_t nvar, vec_t &x, double &fmin, func_t &func)=0
 Calculate the minimum fmin of func w.r.t the array x of size nvar.
virtual int print_iter (size_t nv, vec_t &x, double y, int iter, double tptr, std::string comment)
 Print out iteration information.
virtual const char * type ()
 Return string denoting type, "sim_anneal".

Data Fields

rng_t def_rng
 The default random number generator.

Member Function Documentation

template<class func_t = multi_funct, class vec_t = ovector_base, class rng_t = gsl_rnga>
virtual int sim_anneal< func_t, vec_t, rng_t >::print_iter ( size_t  nv,
vec_t &  x,
double  y,
int  iter,
double  tptr,
std::string  comment 
) [inline, virtual]

Depending on the value of the variable verbose, this prints out the iteration information. If verbose=0, then no information is printed, while if verbose>1, then after each iteration, the present values of x and y are output to std::cout along with the iteration number. If verbose>=2 then each iteration waits for a character.

Definition at line 87 of file sim_anneal.h.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).

Get Object-oriented Scientific Computing
Lib at SourceForge.net. Fast, secure and Free Open Source software
downloads.