golib
0.5
|
Convenience class taking a functor and providing the OptFunction interface. More...
#include <goopt.h>
Public Types | |
typedef OptFunction< matrix_type, vector_type > | parent |
![]() | |
typedef vector_type::value_type | value_type |
Value of the matrix and vector types matrix_type and vector_type. | |
Public Member Functions | |
OptFunctor (goAutoPtr< goFunctorBase1< typename parent::value_type, const vector_type & > > f, double eps=0.01) | |
Constructor. More... | |
virtual parent::value_type | operator() (const vector_type &x) |
Evaluates the given functor at x. More... | |
![]() | |
virtual void | grad (vector_type &x, vector_type &ret) |
Calculate the gradient of f at x. More... | |
virtual void | hessian (vector_type &x, matrix_type &ret) |
Calculate the Hessian of f at x. More... | |
Additional Inherited Members | |
![]() | |
OptFunction (double eps=0.01) | |
Constructor. More... | |
Convenience class taking a functor and providing the OptFunction interface.
If you do not want to derive a new class for each function you want to minimise, use this in conjunction with the goFunctorBase and goFunctor related classes to provide an interface compatible with the NewtonOpt family of classes.
matrix_type | Matrix type, typically goMath::Matrix |
vector_type | Vector type, typically goMath::Vector |
|
inline |
Constructor.
parent::value_type | The return type of the method or function, i.e. the type of the given matrix_type and vector_type types. |
f | The functor to minimise |
eps | Epsilon, see OptFunction::OptFunction() |
|
inlinevirtual |
Evaluates the given functor at x.
Implements goMath::OptFunction< matrix_type, vector_type >.