golib  0.5
goMath::OptFunctor< matrix_type, vector_type > Class Template Reference

Convenience class taking a functor and providing the OptFunction interface. More...

#include <goopt.h>

Public Types

typedef OptFunction< matrix_type, vector_typeparent
 
- Public Types inherited from goMath::OptFunction< matrix_type, vector_type >
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...
 
- Public Member Functions inherited from goMath::OptFunction< matrix_type, vector_type >
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

- Protected Member Functions inherited from goMath::OptFunction< matrix_type, vector_type >
 OptFunction (double eps=0.01)
 Constructor. More...
 

Detailed Description

template<class matrix_type, class vector_type>
class goMath::OptFunctor< matrix_type, vector_type >

Convenience class taking a functor and providing the OptFunction interface.

See also
NewtonOpt, NewtonOptEq, OptFunction

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.

Parameters
matrix_typeMatrix type, typically goMath::Matrix
vector_typeVector type, typically goMath::Vector

Constructor & Destructor Documentation

◆ OptFunctor()

template<class matrix_type , class vector_type >
goMath::OptFunctor< matrix_type, vector_type >::OptFunctor ( goAutoPtr< goFunctorBase1< typename parent::value_type, const vector_type & > >  f,
double  eps = 0.01 
)
inline

Constructor.

Parameters
parent::value_typeThe return type of the method or function, i.e. the type of the given matrix_type and vector_type types.
fThe functor to minimise
epsEpsilon, see OptFunction::OptFunction()

Member Function Documentation

◆ operator()()

template<class matrix_type , class vector_type >
virtual parent::value_type goMath::OptFunctor< matrix_type, vector_type >::operator() ( const vector_type x)
inlinevirtual

Evaluates the given functor at x.

Returns
f(x), the value of the functor at x

Implements goMath::OptFunction< matrix_type, vector_type >.


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