PaGMO  1.1.5
Public Member Functions | Protected Member Functions | Friends
pagmo::algorithm::snopt Class Reference

Wrapper for the SNOPT solver. More...

#include <snopt.h>

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

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.
 

Detailed Description

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.

Author
Dario Izzo (dario.nosp@m..izz.nosp@m.o@goo.nosp@m.glem.nosp@m.ail.c.nosp@m.om)

Definition at line 67 of file snopt.h.

Constructor & Destructor Documentation

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.

Parameters
[in]majorNumber of major iterations (refer to SNOPT manual).
[in]feasFeasibility tolerance (refer to SNOPT manual).
[in]optOptimality tolerance (refer to SNOPT manual).
Exceptions
value_errorif major is not positive, and feas,opt are not in $]0,1[$

Definition at line 103 of file snopt.cpp.

Member Function Documentation

void pagmo::algorithm::snopt::evolve ( population pop) const
virtual

Evolve implementation.

Run SNOPT with the parameters specified in the constructor At the end velocity is updated

Parameters
[in,out]popinput/output pagmo::population to be evolved.

Implements pagmo::algorithm::base.

Definition at line 131 of file snopt.cpp.

void pagmo::algorithm::snopt::file_output ( const bool  p)

Activate file output.

Activate SNOPT screen output by setting iPrint to 15 and setting the file name to the problem typeid

Parameters
[in]ptrue or false

Definition at line 335 of file snopt.cpp.

std::string pagmo::algorithm::snopt::human_readable_extra ( ) const
protectedvirtual

Extra human readable algorithm info.

Returns
a formatted string displaying the parameters of the algorithm.

Reimplemented from pagmo::algorithm::base.

Definition at line 348 of file snopt.cpp.


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