Class anneal_para (o2scl)

O2scl : Class List

template<class func_t = multi_funct, class vec_t = boost::numeric::ublas::vector<double>>
class anneal_para : public o2scl::anneal_gsl<multi_funct, boost::numeric::ublas::vector<double>>

Multidimensional minimization by simulated annealing (OpenMP/MPI version)

This class works particularly well for functions which are not trivial to evaluate, i.e. functions where the execution time is more longer than the bookkeeping that anneal_para performs between trials. For functions which satisfy this requirement, this algorithm scales nearly linearly with the number of processors.

Verbose I/O for this class happens only outside the parallel regions unless the user places I/O in the streams in the function that is specified.

Basic usage

inline virtual int mmin(size_t nv, vec_t &x0, double &fmin, std::vector<func_t> &func)

Desc.

inline virtual int next_para(size_t nvar, vec_t &x_old, double min_old, vec_t &x_new, double min_new, double &T, size_t n_moves, vec_t &best_x, double best_E, int &finished)

Determine how to change the minimization for the next iteration.

inline virtual int mmin(size_t nv, vec_t &x0, double &fmin, func_t &func)

Desc.

inline virtual const char *type()

Return string denoting type (“anneal_para”)

Public Types

typedef boost::numeric::ublas::vector<double> ubvector

Public Functions

inline anneal_para()
inline virtual ~anneal_para()
inline virtual int step_para(vec_t &x, vec_t &sx, int nvar, size_t ithread)

Make a step to a new attempted minimum.

Public Members

size_t n_threads

The number of OpenMP threads.

double start_time

The MPI starting time.

double max_time

The maximum time.

bool collect_all_ranks

If true, obtain the global minimum over all MPI ranks (default true)

std::vector<rng<>> vrng