All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
roboptim::UserIntermediateCallback Struct Reference

Functor called at the end of each iteration. More...

#include <roboptim/core/plugin/ipopt-common.hh>

Public Member Functions

 UserIntermediateCallback ()
 Default constructor.
virtual ~UserIntermediateCallback ()
 Virtual destructor.
virtual bool operator() (Ipopt::AlgorithmMode, int, double, double, double, double, double, double, double, double, int, const Ipopt::IpoptData *, Ipopt::IpoptCalculatedQuantities *)
 Callback to be called.

Detailed Description

Functor called at the end of each iteration.

By inheriting this type and implementing the operator () method, then setting it as the userIntermediateCallback of your solver, one can define a custom behavior to be executed at the end of each iteration.

See http://en.wikipedia.org/wiki/Function_object#In_C_and_C.2B.2B for more information about functors.

Functor parameters match original Ipopt parameters, see Ipopt documentation to read explanation regarding their mathematical meaning.

Constructor & Destructor Documentation

roboptim::UserIntermediateCallback::UserIntermediateCallback ( )
inline

Default constructor.

virtual roboptim::UserIntermediateCallback::~UserIntermediateCallback ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

virtual bool roboptim::UserIntermediateCallback::operator() ( Ipopt::AlgorithmMode  ,
int  ,
double  ,
double  ,
double  ,
double  ,
double  ,
double  ,
double  ,
double  ,
int  ,
const Ipopt::IpoptData *  ,
Ipopt::IpoptCalculatedQuantities *   
)
inlinevirtual

Callback to be called.

You can implement this function yourself. Default version returns true.

Returns
true means continue optimizating (or finish if it is the last iteration), false interrupt the optimization now.