PaGMO  1.1.5
Public Member Functions | Protected Member Functions | Friends
pagmo::algorithm::gsl_gradient Class Referenceabstract

Wrapper for GSL minimisers with derivatives. More...

#include <gsl_gradient.h>

Inheritance diagram for pagmo::algorithm::gsl_gradient:
Inheritance graph
[legend]

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.
 

Detailed Description

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.

See also
algorithm::base_gsl for more information.
Author
Francesco Biscani (blues.nosp@m.carn.nosp@m.i@gma.nosp@m.il.c.nosp@m.om)

Definition at line 51 of file gsl_gradient.h.

Constructor & Destructor Documentation

pagmo::algorithm::gsl_gradient::gsl_gradient ( int  max_iter,
const double &  grad_tol,
const double &  numdiff_step_size,
const double &  step_size,
const double &  tol 
)
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.

Parameters
[in]max_itermaximum number of iterations allowed.
[in]grad_toltolerance when testing the norm of the gradient as stopping criterion.
[in]numdiff_step_sizestep size for the numerical computation of the gradient.
[in]tolaccuracy of the line minimisation.
[in]step_sizesize of the first trial step.

Definition at line 57 of file gsl_gradient.cpp.

Member Function Documentation

void pagmo::algorithm::gsl_gradient::evolve ( population pop) const
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.

Parameters
[in,out]poppopulation to evolve.

Implements pagmo::algorithm::base.

Definition at line 145 of file gsl_gradient.cpp.

virtual const gsl_multimin_fdfminimizer_type* pagmo::algorithm::gsl_gradient::get_gsl_minimiser_ptr ( ) const
protectedpure virtual

Selected minimiser.

This function will return a pointer to the GSL minimiser selected by the derived class.

Returns
pointer to a GSL minimiser with derivatives.

Implemented in pagmo::algorithm::gsl_bfgs, pagmo::algorithm::gsl_bfgs2, pagmo::algorithm::gsl_fr, and pagmo::algorithm::gsl_pr.

std::string pagmo::algorithm::gsl_gradient::human_readable_extra ( ) const
virtual

Extra information in human-readable format.

Returns
a formatted string displaying the parameters of the algorithm.

Reimplemented from pagmo::algorithm::base.

Definition at line 264 of file gsl_gradient.cpp.


The documentation for this class was generated from the following files: