PaGMO
1.1.5
|
Wrapper for GSL minimisers with derivatives. More...
#include <gsl_gradient.h>
Public Member Functions | |
void | evolve (population &) const |
Evolve method. More... | |
std::string | human_readable_extra () const |
Extra information in human-readable format. More... | |
Public Member Functions inherited from pagmo::algorithm::base_gsl | |
base_gsl () | |
Default constructor. More... | |
Public Member Functions inherited from pagmo::algorithm::base | |
base () | |
Default constructor. More... | |
virtual base_ptr | clone () const =0 |
Clone method. More... | |
virtual | ~base () |
Trivial destructor. More... | |
std::string | human_readable () const |
Return human readable representation of the algorithm. More... | |
virtual std::string | get_name () const |
Get algorithm's name. More... | |
void | set_screen_output (const bool p) |
Setter-Getter for protected m_screen_output data. More... | |
bool | get_screen_output () const |
Gets screen output. More... | |
void | reset_rngs (const unsigned int) const |
Resets the seed of the internal rngs using a user-provided seed. More... | |
Protected Member Functions | |
gsl_gradient (int, const double &, const double &, const double &, const double &) | |
Constructor. More... | |
virtual const gsl_multimin_fdfminimizer_type * | get_gsl_minimiser_ptr () const =0 |
Selected minimiser. More... | |
Friends | |
class | boost::serialization::access |
Additional Inherited Members | |
Static Protected Member Functions inherited from pagmo::algorithm::base_gsl | |
static double | objfun_wrapper (const gsl_vector *, void *) |
Objective function wrapper. More... | |
Protected Attributes inherited from pagmo::algorithm::base | |
bool | m_screen_output |
Indicates to the derived class whether to print stuff on screen. | |
rng_double | m_drng |
Random number generator for double-precision floating point values. | |
rng_uint32 | m_urng |
Random number generator for unsigned integer values. | |
unsigned int | m_fevals |
A counter for the number of function evaluations. | |
Wrapper for GSL minimisers with derivatives.
This class can be used to build easily a wrapper around a GSL minimiser with derivatives. The gradient of the objective function will be calculated numerically via the gsl_deriv_central GSL function.
Definition at line 51 of file gsl_gradient.h.
|
protected |
Constructor.
Allows to specify all the parameters needed to initialise a GSL minimiser with derivatives, as specified in the GSL documentation. Will fail if max_iter is negative or if at least one of the other parameters is negative.
[in] | max_iter | maximum number of iterations allowed. |
[in] | grad_tol | tolerance when testing the norm of the gradient as stopping criterion. |
[in] | numdiff_step_size | step size for the numerical computation of the gradient. |
[in] | tol | accuracy of the line minimisation. |
[in] | step_size | size of the first trial step. |
Definition at line 57 of file gsl_gradient.cpp.
|
virtual |
Evolve method.
The best member of the population will be used as starting point for the minimisation process. The algorithm will stop if the gradient falls below the grad_tol parameter, if the maximum number of iterations max_iter is exceeded or if the inner GSL routine call reports an error (which will be logged on std::cout). After the end of the minimisation process, the minimised decision vector will replace the best individual in the population, after being modified to fall within the problem bounds if necessary.
[in,out] | pop | population to evolve. |
Implements pagmo::algorithm::base.
Definition at line 145 of file gsl_gradient.cpp.
|
protectedpure virtual |
Selected minimiser.
This function will return a pointer to the GSL minimiser selected by the derived class.
Implemented in pagmo::algorithm::gsl_bfgs, pagmo::algorithm::gsl_bfgs2, pagmo::algorithm::gsl_fr, and pagmo::algorithm::gsl_pr.
|
virtual |
Extra information in human-readable format.
Reimplemented from pagmo::algorithm::base.
Definition at line 264 of file gsl_gradient.cpp.