PaGMO
1.1.5
|
Wrapper for the SNOPT solver. More...
#include <snopt.h>
Public Member Functions | |
snopt (const int major=100, const double feas=1e-10, const double opt=1e-4) | |
Constructor. More... | |
base_ptr | clone () const |
Clone method. | |
void | evolve (population &) const |
Evolve implementation. More... | |
void | file_output (const bool) |
Activate file output. More... | |
std::string | get_name () const |
Algorithm name. | |
Public Member Functions inherited from pagmo::algorithm::base | |
base () | |
Default constructor. More... | |
virtual | ~base () |
Trivial destructor. More... | |
std::string | human_readable () const |
Return human readable representation of the algorithm. 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 | |
std::string | human_readable_extra () const |
Extra human readable algorithm info. More... | |
Friends | |
class | boost::serialization::access |
Additional Inherited Members | |
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 the SNOPT solver.
SNOPT is a quite popular commercial solver coded in FORTRAN77 by GILL and MURRAY. Its popularity stems from its being able to solve efficiently many different problems thanks to what many would call 'black-magic' heuristic implemented in the solver that is otherwise an SQP solver. We provide in PaGMO the wrappers around the libraries that the user needs to have installed and licenced for in his computer.
In order to interface to SNOPT succesfully, PaGMO needs to find in the system the libraries: snopt, snprint, blas, f2c, m and gfortran (in case the snopt libraries were compiled using gfortran)
CAREFUL: 1 - SNOPT works only for minimization. 2 - The final solution is guaranteed to be within the box constraints by forcing it after the snopt call
From the SNOPT User-Manual:
SNOPT is a general-purpose system for constrained optimization. It minimizes a linear or nonlinear function subject to bounds on the variables and sparse linear or nonlinear constraints. It is suitable for large-scale linear and quadratic programming and for linearly constrained optimization, as well as for general nonlinear programs. SNOPT finds solutions that are locally optimal, and ideally any nonlinear functions should be smooth and users should provide gradients. It is often more widely useful. For example, local optima are often global solutions, and discontinuities in the function gradients can often be tolerated if they are not too close to an optimum. Unknown gradients are estimated by finite differences.
pagmo::algorithm::snopt::snopt | ( | const int | major = 100 , |
const double | feas = 1e-10 , |
||
const double | opt = 1e-4 |
||
) |
Constructor.
Allows to specify some of the parameters of the SNOPT solver.
[in] | major | Number of major iterations (refer to SNOPT manual). |
[in] | feas | Feasibility tolerance (refer to SNOPT manual). |
[in] | opt | Optimality tolerance (refer to SNOPT manual). |
value_error | if major is not positive, and feas,opt are not in |
|
virtual |
Evolve implementation.
Run SNOPT with the parameters specified in the constructor At the end velocity is updated
[in,out] | pop | input/output pagmo::population to be evolved. |
Implements pagmo::algorithm::base.
void pagmo::algorithm::snopt::file_output | ( | const bool | p | ) |
|
protectedvirtual |
Extra human readable algorithm info.
Reimplemented from pagmo::algorithm::base.