23 #ifndef O2SCL_ANNEAL_H 24 #define O2SCL_ANNEAL_H 32 #include <boost/config.hpp> 33 #include <boost/numeric/ublas/vector.hpp> 34 #include <boost/numeric/ublas/matrix.hpp> 36 #include <o2scl/multi_funct.h> 37 #include <o2scl/mmin.h> 38 #include <o2scl/rng_gsl.h> 39 #include <o2scl/prob_dens_func.h> 41 #ifndef DOXYGEN_NO_O2NS 70 #ifdef O2SCL_NEVER_DEFINED 86 virtual int mmin(
size_t nvar, vec_t &x,
double &fmin,
98 virtual int print_iter(
size_t nv, vec_t &x,
double y,
int iter,
99 double tptr, std::string comment)
101 if (this->
verbose<=0)
return 0;
106 (*this->
outs) << comment <<
" Iteration: " << iter << std::endl;
108 for(i=0;i<nv;i++) std::cout << x[i] <<
" ";
109 std::cout << std::endl;
110 (*this->
outs) <<
"y: " << y <<
" Tptr: " << tptr << std::endl;
112 (*this->
outs) <<
"Press a key and type enter to continue. ";
127 virtual const char *
type() {
return "anneal_base"; }
153 #ifndef DOXYGEN_NO_O2NS The main O<span style='position: relative; top: 0.3em; font-size: 0.8em'>2</span>scl O$_2$scl names...
std::istream * ins
Stream for verbose input.
std::ostream * outs
Stream for verbose output.
mmin_base< func_t, dfunc_t, vec_t > & operator=(const mmin_base< func_t, dfunc_t, vec_t > &mb)
Copy constructor from operator=.
o2scl::prob_dens_uniform dist
The random distribution object.
int verbose
Output control.
virtual const char * type()
Return string denoting type, "anneal_base".
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.
Multidimensional minimization [abstract base].
Simulated annealing base.
rng_t rng
The default random number generator.
Random number generator (GSL)
virtual int print_iter(size_t nv, vec_t &x, double y, int iter, double tptr, std::string comment)
Print out iteration information.
std::function< double(size_t, const boost::numeric::ublas::vector< double > &)> multi_funct11
Multi-dimensional function typedef.
int ntrial
Maximum number of iterations.